Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Add ArrayFile & EnvFile Parsing, replace ConfigWriter internal logic #40

Merged
merged 108 commits into from
Mar 16, 2022

Conversation

jaxwilko
Copy link
Member

This is a POC PR proposing a replacement for ConfigWriter. Currently, ConfigWriter is used to update php config files, for example during winter install.

In this PR I've added a new class ConfigFile, which can be used to modify any php config file without risking the same kind of corruption that can be caused using ConfigWriter. The reason for this improvement is due to the fundemental differences in approach, where ConfigWriter modifies the file contents as a string, ConfigFile uses nikic/php-parser to generate an ast of the config file and allows us to modify the code as php objects before "printing" them back out using the WinterPrinter (an exstension to PhpParser\PrettyPrinter\Standard).

Example

Config file:

<?php

return [
    'foo' => env('ENV_VALUE', 'bar'),
    'bar' => [
         'winter' => 'cms'
    ]
];

Sample usage:

use Winter\Storm\Config\ConfigFile;

$config = ConfigFile::read('/path/to/file');
$config->set('foo', 'foo')
    ->set('bar.winter', 'is coming');
$config->write();

Will update the config file to:

<?php

return [
    'foo' => env('ENV_VALUE', 'foo'),
    'bar' => [
         'winter' => 'is coming'
    ]
];

There are currently some issues when node types are swapped by setting a value that differs in type from the originally parsed value, but they should be simple to fix. I have modified the winter:install command to use ConfigFile over ConfigWriter and it works nicely, however it would be good to get some feed back on this core peice before opening a PR for the install command.

Please let me know any thoughts or suggestions you have :)

@LukeTowers
Copy link
Member

Oooh shiny :) Can't wait to review this :) 👀

@mjauvin
Copy link
Member

mjauvin commented Jul 1, 2021

Would it be possible to add a comma after the last item of an array when writing the results to the file (to ease manual maintainability)?

@jaxwilko
Copy link
Member Author

jaxwilko commented Jul 1, 2021

@mjauvin ah, it already does, my example just doesn't show it.

For reference here is a config I just saved using winter:install:

image

Also new line padding on single line comments has now been fixed as of 524561f

@bennothommo
Copy link
Member

This is awesome @jaxwilko. Well done :)

@jaxwilko
Copy link
Member Author

jaxwilko commented Jul 2, 2021

The issues relating to updating a value from one type to another (i.e. int -> bool) has now be resolved. I added a load of code and so that we would:

  • Check if note is same type as incoming value (i.e. currently string, updating to string).
  • If match, update the node in place.
  • If not match, create a new node of the correct type and replace the original node.

Rather than doing all that extra work, it's far simpiler if we just:

  • Create a new node of the correct type and replace the original node

This solves the casting issue and cuts down on code / processing.

@jaxwilko jaxwilko changed the title [WIP] Config Writer Replacement Config Writer Replacement Jul 2, 2021
@jaxwilko jaxwilko requested a review from LukeTowers July 2, 2021 11:09
@jaxwilko
Copy link
Member Author

jaxwilko commented Jul 2, 2021

The following is documentation I'm writing now while it's fresh in my head.

Documentation

ConfigFile provides the ability to update php config files in place. A side effect it can also be used to reformat a config file in the Winter style.

Init

To initalize the ConfigFile object, you can use the static read() method:

$config = ConfigFile::read('/path/to/file');

Alternatively, you can directly initalize the object:

$config = new ConfigFile($ast, $filePath = null, $printer = null);

However initalizing the object this way requires you to parse the config file manually using PhpParser\Parser and pass the result as the first argument.

Updating a value

To update a value in the config, call the set() method:

$config->set('property.key', $value);

If you have multiple properties to update, you can also pass an array:

$config->set([
    'property.key' => $value,
    'property.other_key' => $otherValue
]);

Saving

To retrieve the "printed" result as a string you can use the render() method:

$string = $config->render();

If you set use the ConfigFile::read() method for initialization or set the $filePath property when initing the object, you can call the write() method to overwrite the original file:

$config = ConfigFile::read('/path/to/config.php');
$config->write(); // saves to /path/to/config.php

Alternatively you can pass write() a file path to save to:

$config = ConfigFile::read('/path/to/config.php');
$config->write('/path/to/config.new.php'); // saves to /path/to/config.new.php

Copy link
Member

@bennothommo bennothommo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the below changes, could you provide some details in the docblocks for the main class methods? I assume these were auto-generated through PHPStorm, but don't really describe what the methods are doing.

src/Config/ConfigFile.php Outdated Show resolved Hide resolved
src/Config/ConfigFile.php Outdated Show resolved Hide resolved
src/Config/ConfigFile.php Outdated Show resolved Hide resolved
src/Config/ConfigFile.php Outdated Show resolved Hide resolved
src/Config/ConfigFile.php Outdated Show resolved Hide resolved
@LukeTowers

This comment was marked as resolved.

src/Config/ConfigWriter.php Outdated Show resolved Hide resolved
src/Foundation/Console/KeyGenerateCommand.php Outdated Show resolved Hide resolved
src/Foundation/Console/KeyGenerateCommand.php Show resolved Hide resolved
src/Parse/Contracts/DataFileInterface.php Outdated Show resolved Hide resolved
src/Parse/Contracts/DataFileInterface.php Outdated Show resolved Hide resolved
src/Parse/Contracts/DataFileInterface.php Outdated Show resolved Hide resolved
src/Parse/EnvFile.php Outdated Show resolved Hide resolved
src/Parse/EnvFile.php Show resolved Hide resolved
src/Parse/EnvFile.php Outdated Show resolved Hide resolved
src/Parse/EnvFile.php Outdated Show resolved Hide resolved
@LukeTowers LukeTowers merged commit 96e496a into wip/1.2 Mar 16, 2022
@LukeTowers LukeTowers deleted the wip/config-writer-replacement branch March 16, 2022 20:53
LukeTowers added a commit to wintercms/docs that referenced this pull request Mar 16, 2022
Replaces #48, credit for initial content to @jaxwilko. Documents wintercms/storm#40
mjauvin added a commit that referenced this pull request Jun 5, 2022
commit dff4e6e
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jun 3 02:59:07 2022 +0100

    Removed deferable from redis provider (#85)

    See wintercms/winter#501

commit 6d95046
Author: Luke Towers <[email protected]>
Date:   Tue May 31 10:47:21 2022 -0600

    Ported laravel cache provider without implementing deferable (#84)

    Required for wintercms/winter#501. See also wintercms/winter#493
    Also removed upsert tests ref: 04230d5

commit c9a83dc
Author: Luke Towers <[email protected]>
Date:   Mon May 23 15:11:40 2022 -0600

    Added ProcessesQuery console helper trait to make processing large numbers of records easier.

commit 0f7e0ff
Author: Luke Towers <[email protected]>
Date:   Sun May 22 11:34:50 2022 -0600

    Fix support for Pivot models in 1.2

    Credit to @bennothommo in a780758. Replaces part of #65

commit b4b67bb
Merge: 5701bc0 38db1fc
Author: Ben Thomson <[email protected]>
Date:   Tue Apr 26 09:45:14 2022 +0800

    Merge branch 'develop' into wip/1.2

commit 38db1fc
Author: Marc Jauvin <[email protected]>
Date:   Mon Apr 25 21:43:19 2022 -0400

    remove non-existent argument to Ini::parse() method (#82)

commit 5701bc0
Author: Marc Jauvin <[email protected]>
Date:   Mon Apr 25 21:43:19 2022 -0400

    remove non-existent argument to Ini::parse() method (#82)

commit 8e96bcb
Author: Marc Jauvin <[email protected]>
Date:   Tue Apr 5 13:24:54 2022 -0400

    Fire mailer.beforeRegister event in mailer() method (#79)

    Related: wintercms/winter#522

    This fix is needed because if the event is fired in resolve() method, the $name variable has already been defined (from a call to getDefaultDriver() in the base mailer() method)

    ref. https://github.com/laravel/framework/blob/9.x/src/Illuminate/Mail/MailManager.php#L70

    Note: if the $name argument is provided to the mailer() method, the problem does not occur because the config is forced to that driver name.

commit 0bb0989
Author: Luke Towers <[email protected]>
Date:   Sun Apr 3 14:46:47 2022 -0600

    Fix scaffolding path overwriting logic

commit c1fb3c1
Author: Luke Towers <[email protected]>
Date:   Sun Apr 3 14:06:42 2022 -0600

    Align GeneratorCommand with Laravel (#76)

    Improves the alignment of the base GeneratorCommand with the Laravel implementation. Related: wintercms/winter#486

commit aeb5268
Author: Luke Towers <[email protected]>
Date:   Fri Apr 1 15:08:23 2022 -0600

    Fix tests

commit 9256b87
Author: Luke Towers <[email protected]>
Date:   Mon Mar 28 14:21:05 2022 -0600

    Only apply YAML preprocessing if the initial parse attempt fails

commit 2ca5797
Author: Luke Towers <[email protected]>
Date:   Mon Mar 28 14:20:44 2022 -0600

    Revert "Check for a space / end before surrounding keys with quotes"

    This reverts commit cd4b82d.

commit cd4b82d
Author: Ben Thomson <[email protected]>
Date:   Mon Mar 28 14:06:59 2022 +0800

    Check for a space / end before surrounding keys with quotes

commit 7633fd9
Author: Luke Towers <[email protected]>
Date:   Wed Mar 16 14:57:35 2022 -0600

    Style fix

commit 96e496a
Merge: c76f1fa c7a5f6a
Author: Luke Towers <[email protected]>
Date:   Wed Mar 16 14:53:28 2022 -0600

    Merge pull request #40 from wintercms/wip/config-writer-replacement

    [Enhancement] Add ArrayFile & EnvFile Parsing, replace ConfigWriter internal logic

commit c7a5f6a
Author: Jack Wilkinson <[email protected]>
Date:   Wed Mar 16 13:06:32 2022 +0000

    Added fix for token parsing running into comma tokens and breaking

commit e15806d
Merge: 4899679 b0e7b4f
Author: Jack Wilkinson <[email protected]>
Date:   Wed Mar 16 12:18:42 2022 +0000

    Merge branch 'wip/config-writer-replacement' of github.com:wintercms/storm into wip/config-writer-replacement

commit 4899679
Author: Jack Wilkinson <[email protected]>
Date:   Wed Mar 16 12:18:12 2022 +0000

    Added fix for subitems being picked up in lexer tokens

commit e6c8434
Author: Jack Wilkinson <[email protected]>
Date:   Wed Mar 16 12:16:38 2022 +0000

    Added subitem comment test

commit b0e7b4f
Author: Ben Thomson <[email protected]>
Date:   Wed Mar 16 11:49:03 2022 +0800

    Code dusting and explicit typing from review

commit d14374d
Author: Luke Towers <[email protected]>
Date:   Tue Mar 15 21:38:40 2022 -0600

    KeyGenerateCommand cleanup

commit 5ca79e7
Author: Ben Thomson <[email protected]>
Date:   Wed Mar 16 11:32:56 2022 +0800

    Update src/Foundation/Console/KeyGenerateCommand.php

commit 62950e0
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 15 22:37:54 2022 +0000

    Added \r trim to comment test

commit 7e56951
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 15 22:35:11 2022 +0000

    Added fix to ConfigWriter to support passing lexer to ArrayFile instance

commit 6e0ddb3
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 15 22:29:21 2022 +0000

    More styling fixes in test fixture

commit 725fb4d
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 15 22:27:48 2022 +0000

    Added style fixes

commit 6ee5ec3
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 15 22:25:40 2022 +0000

    Added non-attribute comment handling test

commit 573e606
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 15 22:25:04 2022 +0000

    Added support for lexer token parsing and additional comment handling

commit 78bcf11
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 15 22:24:01 2022 +0000

    Bound lexer to ArrayFile instance

commit c76f1fa
Author: Luke Towers <[email protected]>
Date:   Mon Mar 14 15:34:58 2022 -0600

    Wait for the dispatcher to be set before booting model events

    This fixes an issue that occurs when a model class is instantiated before the DatabaseServiceProvider can be booted (thus calling Model::setEventDispatcher()). Previously Winter would proceed with booting the nicer events, and then helpfully set a flag the events for the current model class had already been booted; however this would cause any and all "nice" model events to fail since they were never actually registered with an event dispatcher since Laravel silently discarded the required listeners when the $dispatcher property wasn't set.

commit b977610
Author: Luke Towers <[email protected]>
Date:   Tue Mar 8 20:51:15 2022 -0600

    Improve DX for dynamically adding relationships

    This improves the developer experience for dynamically adding relationships to an external model when extending the model. Previously the developer would have to set the relation property directly themselves by merging their additions with the existing definitions and usually they wouldn't include any error checking logic.

commit 0af5c16
Author: Luke Towers <[email protected]>
Date:   Tue Mar 8 15:51:47 2022 -0600

    Typehint the app property for moduleserviceproviders

commit 1fe835b
Author: Marc Jauvin <[email protected]>
Date:   Mon Mar 7 20:06:12 2022 -0500

    Allow array of email addresses without names (#75)

commit 91f1dac
Author: Jack Wilkinson <[email protected]>
Date:   Fri Mar 4 18:46:15 2022 +0000

    Added fixes for whitespace issues

commit 9fda6cd
Author: Luke Towers <[email protected]>
Date:   Thu Mar 3 19:30:00 2022 -0600

    Trim useless whitespace

    @jaxwilko's favourite piece of the whole ArrayFile parser ;)

commit cf98dcf
Merge: 892ed2a 36e29a4
Author: Luke Towers <[email protected]>
Date:   Thu Mar 3 19:03:38 2022 -0600

    Merge branch 'wip/1.2' into wip/config-writer-replacement

commit 892ed2a
Author: Jack Wilkinson <[email protected]>
Date:   Wed Mar 2 16:56:33 2022 +0000

    Simplified code by always apending parens on include/require stmts

commit c098853
Author: Jack Wilkinson <[email protected]>
Date:   Wed Mar 2 16:54:43 2022 +0000

    Added code to check include position in ast and append parens correctly

commit 440e1fb
Author: Jack Wilkinson <[email protected]>
Date:   Wed Mar 2 16:53:47 2022 +0000

    Added include test to ensure parens on correct include stmts

commit 0ec5553
Author: Jack Wilkinson <[email protected]>
Date:   Wed Mar 2 16:52:37 2022 +0000

    Moved fixtures into arrayfile dir

commit f74bd5a
Merge: ec04043 27031ee
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 1 18:43:11 2022 +0000

    Manual merge wip/1.2 into wip/config-writer-replacement

commit ec04043
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 1 18:38:38 2022 +0000

    Added support for leading imports & expressions before a return stmt

commit 4a036ea
Author: Jack Wilkinson <[email protected]>
Date:   Tue Mar 1 18:38:13 2022 +0000

    Added config test fixtures

commit 399347a
Author: Eric Pfeiffer <[email protected]>
Date:   Mon Feb 28 14:15:38 2022 -0600

    Fix docblock typehint (#71)

commit f12c2b9
Author: Luke Towers <[email protected]>
Date:   Thu Feb 17 20:26:52 2022 -0600

    Refactor ConfigWriter to use ArrayFile parser internally

commit 74ca4d8
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 23:03:20 2022 -0600

    Fix tests, add test case for $throwIfMissing

commit a9fa826
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 22:55:40 2022 -0600

    Cleanup docblocks

commit 5b186ac
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 21:48:21 2022 -0600

    Use Str facade instead of helper functions

commit 9c0057c
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 21:42:51 2022 -0600

    Improvements to the EnvFile parser

commit 57eafe4
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 16:22:06 2022 -0600

    const() -> constant()

commit 5cfe40d
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 15:35:17 2022 -0600

    Switch back to Laravel's default logic for setting application keys

    Difference that justifies us continuing to override the command is that we will automatically create the .env file if it doesn't exist.

commit 5643d4d
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 15:10:37 2022 -0600

    Require PHP Codesniffer > 3.2

commit 9ea747c
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 15:05:27 2022 -0600

    FileInterface -> DataFileInterface, read() -> open()

commit f4da8f6
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 14:56:59 2022 -0600

    PHPConst -> PHPConstant

commit 4f43d6c
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 14:55:35 2022 -0600

    Fix test name mismatch

commit 6f6d073
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 14:55:25 2022 -0600

    Various cleanup and code review

commit 7c9c63b
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 14:42:24 2022 -0600

    Move ArrayFile tests out of config and into parse

commit 2d64825
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 14:18:22 2022 -0600

    Move config writer into Parse

commit 4f19150
Merge: c2a0aa2 33d50fd
Author: Luke Towers <[email protected]>
Date:   Wed Feb 16 14:05:52 2022 -0600

    Merge 1.2 into config-writer-replacement

commit c2a0aa2
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 14:41:58 2022 +0000

    Swapped out redundent if statement for assigning result of expression

commit 29067a8
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 13:55:04 2022 +0000

    Fixed spelling mistake

commit f60a0ff
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 13:41:05 2022 +0000

    Added test for numeric array keys

commit 4314dfe
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 13:40:21 2022 +0000

    Simplified key insertion logic

commit 1ca70f3
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 13:36:04 2022 +0000

    Added support for setting an array and const value

commit 0caba9d
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 13:34:11 2022 +0000

    Fixed incorrect method description comment

commit 1406191
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 13:33:09 2022 +0000

    Added tests for setting arrays and const values

commit 87d2d9c
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 13:32:32 2022 +0000

    Fixed incorrect comment

commit 29efd28
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 27 13:31:40 2022 +0000

    Added class to represent const expressions

commit 45e3058
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 20 00:59:03 2022 +0000

    Removed usage of PHP_EOL in favour of lf

commit 36a4044
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 20 00:54:49 2022 +0000

    Reverted to heredoc and removed carriage returns from expected samples

commit 1db7bfc
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jan 20 00:22:54 2022 +0000

    Removed incorrect newline at end of expected results

commit 2532b67
Author: Jack Wilkinson <[email protected]>
Date:   Mon Jan 17 15:37:14 2022 +0000

    Switched heredoc test samples for quoted strings

commit 715abd7
Author: Jack Wilkinson <[email protected]>
Date:   Mon Jan 17 15:36:38 2022 +0000

    Switched line ending for rendered output

commit 4f4a00a
Author: Jack Wilkinson <[email protected]>
Date:   Sat Jan 15 17:13:57 2022 +0000

    Switched line ending to unix style when creating empty file

commit bf6c16e
Author: Jack Wilkinson <[email protected]>
Date:   Sat Jan 15 17:12:46 2022 +0000

    Fixed test to be consitant across php versions (RFC: stable_sorting)

commit 110afdf
Author: Jack Wilkinson <[email protected]>
Date:   Sat Jan 15 16:06:33 2022 +0000

    Simplified internal sorting methods

commit f0c9454
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jan 14 03:59:02 2022 +0000

    Added sort() method for ConfigFile

commit bae73fa
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jan 14 03:58:18 2022 +0000

    Added config sort tests

commit dcef6b1
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jan 14 03:05:06 2022 +0000

    Added support for setting env() args to correct types

commit cda726f
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jan 14 03:04:39 2022 +0000

    Updated test to match the correct exception

commit 57a649a
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jan 14 02:58:52 2022 +0000

    Updated ApplicationExceptions to SystemExceptions

commit cdbf2f4
Merge: f9aedbe a208f57
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jan 14 02:52:27 2022 +0000

    Merge branch 'develop' into wip/config-writer-replacement

commit f9aedbe
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jan 14 02:52:04 2022 +0000

    Added double quote escaping

commit a010a9c
Author: Jack Wilkinson <[email protected]>
Date:   Thu Dec 2 11:02:26 2021 +0000

    Added support for null inserts

commit 0581fc6
Author: Jack Wilkinson <[email protected]>
Date:   Thu Dec 2 11:02:01 2021 +0000

    Added test for null insertion

commit b25b8cd
Author: Jack Wilkinson <[email protected]>
Date:   Thu Nov 25 11:59:30 2021 +0000

    Improved function value type handling

commit 4c421b9
Author: Jack Wilkinson <[email protected]>
Date:   Thu Nov 25 11:54:51 2021 +0000

    Added proper class doc

commit 51ef587
Author: Jack Wilkinson <[email protected]>
Date:   Thu Nov 25 11:50:00 2021 +0000

    Added support for setting function calls

commit 7787df1
Author: Jack Wilkinson <[email protected]>
Date:   Thu Nov 25 11:48:47 2021 +0000

    Added tests for adding new functions to a config

commit ba5ed71
Author: Jack Wilkinson <[email protected]>
Date:   Thu Nov 25 11:48:13 2021 +0000

    Added ConfigFunction class

commit ce8f252
Author: Jack Wilkinson <[email protected]>
Date:   Thu Nov 25 10:41:51 2021 +0000

    Added support for recursive array creation using dot notation

commit 69cd152
Author: Jack Wilkinson <[email protected]>
Date:   Thu Nov 25 10:41:15 2021 +0000

    Added tests for recursive array creation

commit 7d8090a
Author: Jack Wilkinson <[email protected]>
Date:   Thu Nov 25 10:40:02 2021 +0000

    Added constructor to enable short syntax

commit 71765a8
Author: Jack Wilkinson <[email protected]>
Date:   Tue Nov 23 17:13:36 2021 +0000

    Added support for creating file on read and appending items to empty array

commit cc439eb
Author: Jack Wilkinson <[email protected]>
Date:   Wed Oct 27 16:39:45 2021 +0100

    Improved parsing and rendering

commit 14fd3c8
Author: Jack Wilkinson <[email protected]>
Date:   Wed Oct 27 16:39:23 2021 +0100

    Improved EnvFile tests

commit b0a9c70
Author: Jack Wilkinson <[email protected]>
Date:   Fri Aug 6 15:21:05 2021 +0100

    Fixed styling issue and unparenthesized ternary issue

commit a8cf24e
Author: Jack Wilkinson <[email protected]>
Date:   Fri Aug 6 15:16:29 2021 +0100

    Switched parser for simple interpreter

commit d58411d
Author: Jack Wilkinson <[email protected]>
Date:   Fri Aug 6 15:14:00 2021 +0100

    Added test comments

commit f74b15a
Author: Jack Wilkinson <[email protected]>
Date:   Fri Aug 6 15:13:33 2021 +0100

    Removed redundent line

commit bbae058
Author: Jack Wilkinson <[email protected]>
Date:   Sun Jul 25 17:00:58 2021 +0100

    Commented out return types

commit 7fe60cc
Author: Jack Wilkinson <[email protected]>
Date:   Sun Jul 25 16:53:38 2021 +0100

    Removed File class usage in favour of file_put_contents

commit d475c2c
Author: Jack Wilkinson <[email protected]>
Date:   Sun Jul 25 16:49:33 2021 +0100

    Added EnvFile class and tests

commit 96dba39
Author: Jack Wilkinson <[email protected]>
Date:   Sun Jul 25 16:49:07 2021 +0100

    Added interface to ConfigFile class

commit 7745ad1
Author: Jack Wilkinson <[email protected]>
Date:   Sun Jul 25 16:47:21 2021 +0100

    Added interface for config file modifiers

commit b2fac15
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jul 14 14:20:44 2021 +0100

    Updated dot notation comment

commit 418d6cd
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jul 14 14:19:31 2021 +0100

    Added fixes to set method to ensure types are correctly updated

commit c097187
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jul 14 14:09:04 2021 +0100

    Added descriptive comments

commit 6859072
Author: Jack Wilkinson <[email protected]>
Date:   Tue Jul 6 17:16:28 2021 +0100

    Update src/Config/ConfigFile.php

    Co-authored-by: Ben Thomson <[email protected]>

commit 9904d7c
Author: Jack Wilkinson <[email protected]>
Date:   Tue Jul 6 17:16:11 2021 +0100

    Update src/Config/ConfigFile.php

    Co-authored-by: Ben Thomson <[email protected]>

commit 581e616
Author: Jack Wilkinson <[email protected]>
Date:   Tue Jul 6 17:15:55 2021 +0100

    Update src/Config/ConfigFile.php

    Co-authored-by: Ben Thomson <[email protected]>

commit 31c405a
Author: Jack Wilkinson <[email protected]>
Date:   Tue Jul 6 17:13:29 2021 +0100

    Update src/Config/ConfigFile.php

    Co-authored-by: Ben Thomson <[email protected]>

commit d3f97e1
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jul 2 12:13:10 2021 +0100

    Cleaned up switch statment

commit ec8d643
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jul 2 12:06:32 2021 +0100

    Added doc block for makeAstNode method

commit 4e98e46
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jul 2 11:52:47 2021 +0100

    Switched to replace nodes rather than update in place for simplicity

commit 7156fec
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jul 2 11:51:18 2021 +0100

    Added env default update test

commit 09eff7b
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jul 2 11:30:18 2021 +0100

    Added type casting functionality

commit 3520e88
Author: Jack Wilkinson <[email protected]>
Date:   Fri Jul 2 11:29:51 2021 +0100

    Added array input and casting tests

commit 524561f
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jul 1 01:26:02 2021 +0100

    Added fix so single line comments do not recieve nl padding

commit d75b3a8
Author: Jack Wilkinson <[email protected]>
Date:   Thu Jul 1 00:30:12 2021 +0100

    Added additional handling for object types

commit 179af7c
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jun 30 23:59:56 2021 +0100

    Added ConfigFile tests

commit 0d4b2e2
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jun 30 23:41:08 2021 +0100

    Added method to retrieve ast

commit eb76cc4
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jun 30 23:40:13 2021 +0100

    Removed debug code

commit 45aadb7
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jun 30 23:35:15 2021 +0100

    Added doc blocks and applyed Winter code styling

commit 0707951
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jun 30 23:34:15 2021 +0100

    Added class doc block

commit 00020fa
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jun 30 23:32:21 2021 +0100

    Added ConfigFile class for modifying configs

commit dd20a56
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jun 30 23:30:30 2021 +0100

    Added custom pretty printer for winter style configs

commit 4c71911
Author: Jack Wilkinson <[email protected]>
Date:   Wed Jun 30 23:29:41 2021 +0100

    Required nikic/php-parser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
4 participants