diff --git a/src/Assets/AssetCollection.php b/src/Assets/AssetCollection.php index a5837d67df..47f2e51ecb 100644 --- a/src/Assets/AssetCollection.php +++ b/src/Assets/AssetCollection.php @@ -4,6 +4,4 @@ use Statamic\Data\DataCollection; -class AssetCollection extends DataCollection -{ -} +class AssetCollection extends DataCollection {} diff --git a/src/Auth/Protect/Protectors/Authenticated.php b/src/Auth/Protect/Protectors/Authenticated.php index 3852e30cfd..23eeeabf07 100644 --- a/src/Auth/Protect/Protectors/Authenticated.php +++ b/src/Auth/Protect/Protectors/Authenticated.php @@ -17,7 +17,7 @@ public function protect() } if (! $this->getLoginUrl()) { - throw new ForbiddenHttpException(); + throw new ForbiddenHttpException; } abort(redirect($this->getLoginUrl())); diff --git a/src/Auth/Protect/Protectors/Fallback.php b/src/Auth/Protect/Protectors/Fallback.php index 0ea9394b1f..2cfdc4a205 100644 --- a/src/Auth/Protect/Protectors/Fallback.php +++ b/src/Auth/Protect/Protectors/Fallback.php @@ -8,6 +8,6 @@ class Fallback extends Protector { public function protect() { - throw new ForbiddenHttpException(); + throw new ForbiddenHttpException; } } diff --git a/src/Auth/Protect/Protectors/IpAddress.php b/src/Auth/Protect/Protectors/IpAddress.php index 0f66fb7467..0f775631a3 100644 --- a/src/Auth/Protect/Protectors/IpAddress.php +++ b/src/Auth/Protect/Protectors/IpAddress.php @@ -11,7 +11,7 @@ public function protect() $ips = array_get($this->config, 'allowed', []); if (! in_array(request()->ip(), $ips)) { - throw new ForbiddenHttpException(); + throw new ForbiddenHttpException; } } } diff --git a/src/Auth/Protect/Protectors/Password/PasswordProtector.php b/src/Auth/Protect/Protectors/Password/PasswordProtector.php index 42e2b09bbd..e3c34cbb78 100644 --- a/src/Auth/Protect/Protectors/Password/PasswordProtector.php +++ b/src/Auth/Protect/Protectors/Password/PasswordProtector.php @@ -16,7 +16,7 @@ class PasswordProtector extends Protector public function protect() { if (empty(array_get($this->config, 'allowed', []))) { - throw new ForbiddenHttpException(); + throw new ForbiddenHttpException; } if (request()->isLivePreview()) { diff --git a/src/Console/Commands/MakeAction.php b/src/Console/Commands/MakeAction.php index 1e83c98ff7..f18501fb68 100644 --- a/src/Console/Commands/MakeAction.php +++ b/src/Console/Commands/MakeAction.php @@ -59,7 +59,7 @@ public function handle() */ protected function updateServiceProvider() { - $factory = new BuilderFactory(); + $factory = new BuilderFactory; $actionClassValue = $factory->classConstFetch('Actions\\'.$this->getNameInput(), 'class'); diff --git a/src/Console/Commands/MakeFieldtype.php b/src/Console/Commands/MakeFieldtype.php index 64dd08c02e..4c3423a444 100644 --- a/src/Console/Commands/MakeFieldtype.php +++ b/src/Console/Commands/MakeFieldtype.php @@ -141,7 +141,7 @@ protected function wireUpAddonJs($addon) */ protected function updateServiceProvider() { - $factory = new BuilderFactory(); + $factory = new BuilderFactory; $fieldtypeClassValue = $factory->classConstFetch('Fieldtypes\\'.$this->getNameInput(), 'class'); diff --git a/src/Console/Commands/MakeFilter.php b/src/Console/Commands/MakeFilter.php index b753fa1b19..4d0c7f47ae 100644 --- a/src/Console/Commands/MakeFilter.php +++ b/src/Console/Commands/MakeFilter.php @@ -59,7 +59,7 @@ public function handle() */ protected function updateServiceProvider() { - $factory = new BuilderFactory(); + $factory = new BuilderFactory; $filterClassValue = $factory->classConstFetch('Filters\\'.$this->getNameInput(), 'class'); diff --git a/src/Console/Commands/MakeModifier.php b/src/Console/Commands/MakeModifier.php index 96ef3e8a88..a20c93163f 100644 --- a/src/Console/Commands/MakeModifier.php +++ b/src/Console/Commands/MakeModifier.php @@ -59,7 +59,7 @@ public function handle() */ protected function updateServiceProvider() { - $factory = new BuilderFactory(); + $factory = new BuilderFactory; $modifierClassValue = $factory->classConstFetch('Modifiers\\'.$this->getNameInput(), 'class'); diff --git a/src/Console/Commands/MakeScope.php b/src/Console/Commands/MakeScope.php index 3fc770ad59..b3b3b81141 100644 --- a/src/Console/Commands/MakeScope.php +++ b/src/Console/Commands/MakeScope.php @@ -59,7 +59,7 @@ public function handle() */ protected function updateServiceProvider() { - $factory = new BuilderFactory(); + $factory = new BuilderFactory; $scopeClassValue = $factory->classConstFetch('Scopes\\'.$this->getNameInput(), 'class'); diff --git a/src/Console/Commands/MakeTag.php b/src/Console/Commands/MakeTag.php index ed734c066c..1b570eb89c 100644 --- a/src/Console/Commands/MakeTag.php +++ b/src/Console/Commands/MakeTag.php @@ -59,7 +59,7 @@ public function handle() */ protected function updateServiceProvider() { - $factory = new BuilderFactory(); + $factory = new BuilderFactory; $tagsClassValue = $factory->classConstFetch('Tags\\'.$this->getNameInput(), 'class'); diff --git a/src/Console/Commands/MakeWidget.php b/src/Console/Commands/MakeWidget.php index 61796a0bc0..25d53ae2ed 100644 --- a/src/Console/Commands/MakeWidget.php +++ b/src/Console/Commands/MakeWidget.php @@ -84,7 +84,7 @@ protected function generateWidgetView() */ protected function updateServiceProvider() { - $factory = new BuilderFactory(); + $factory = new BuilderFactory; $widgetClassValue = $factory->classConstFetch('Widgets\\'.$this->getNameInput(), 'class'); diff --git a/src/Console/Commands/SupportZipBlueprint.php b/src/Console/Commands/SupportZipBlueprint.php index bf402ae381..3534d85da7 100644 --- a/src/Console/Commands/SupportZipBlueprint.php +++ b/src/Console/Commands/SupportZipBlueprint.php @@ -34,7 +34,7 @@ protected function createZip($blueprint) { $filename = $blueprint->handle().'-blueprint.zip'; - $zip = new ZipArchive(); + $zip = new ZipArchive; if ($zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== true) { $this->error("Unable to create zip file \"$filename\""); diff --git a/src/Contracts/Assets/QueryBuilder.php b/src/Contracts/Assets/QueryBuilder.php index 5c94f809b3..4b514932ab 100644 --- a/src/Contracts/Assets/QueryBuilder.php +++ b/src/Contracts/Assets/QueryBuilder.php @@ -4,6 +4,4 @@ use Statamic\Contracts\Query\Builder; -interface QueryBuilder extends Builder -{ -} +interface QueryBuilder extends Builder {} diff --git a/src/Contracts/Data/Localizable.php b/src/Contracts/Data/Localizable.php index e058f969fa..962c1b53dc 100644 --- a/src/Contracts/Data/Localizable.php +++ b/src/Contracts/Data/Localizable.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Data; -interface Localizable -{ -} +interface Localizable {} diff --git a/src/Contracts/Entries/Collection.php b/src/Contracts/Entries/Collection.php index 82f54518f0..321388a18e 100644 --- a/src/Contracts/Entries/Collection.php +++ b/src/Contracts/Entries/Collection.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Entries; -interface Collection -{ -} +interface Collection {} diff --git a/src/Contracts/Entries/Entry.php b/src/Contracts/Entries/Entry.php index 23a2da60d2..20cce409a8 100644 --- a/src/Contracts/Entries/Entry.php +++ b/src/Contracts/Entries/Entry.php @@ -4,6 +4,4 @@ use Statamic\Contracts\Data\Localizable; -interface Entry extends Localizable -{ -} +interface Entry extends Localizable {} diff --git a/src/Contracts/Forms/FormRepository.php b/src/Contracts/Forms/FormRepository.php index 6572c94995..491626dbfc 100644 --- a/src/Contracts/Forms/FormRepository.php +++ b/src/Contracts/Forms/FormRepository.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Forms; -interface FormRepository -{ -} +interface FormRepository {} diff --git a/src/Contracts/Routing/UrlBuilder.php b/src/Contracts/Routing/UrlBuilder.php index 6aec3e48be..4b15af4516 100644 --- a/src/Contracts/Routing/UrlBuilder.php +++ b/src/Contracts/Routing/UrlBuilder.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Routing; -interface UrlBuilder -{ -} +interface UrlBuilder {} diff --git a/src/Contracts/Structures/CollectionTree.php b/src/Contracts/Structures/CollectionTree.php index d9c07521bf..3671c776f1 100644 --- a/src/Contracts/Structures/CollectionTree.php +++ b/src/Contracts/Structures/CollectionTree.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Structures; -interface CollectionTree -{ -} +interface CollectionTree {} diff --git a/src/Contracts/Structures/Nav.php b/src/Contracts/Structures/Nav.php index 3448ebd556..273140c792 100644 --- a/src/Contracts/Structures/Nav.php +++ b/src/Contracts/Structures/Nav.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Structures; -interface Nav -{ -} +interface Nav {} diff --git a/src/Contracts/Structures/NavTree.php b/src/Contracts/Structures/NavTree.php index 8366e17582..0ae423413f 100644 --- a/src/Contracts/Structures/NavTree.php +++ b/src/Contracts/Structures/NavTree.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Structures; -interface NavTree -{ -} +interface NavTree {} diff --git a/src/Contracts/Structures/Structure.php b/src/Contracts/Structures/Structure.php index 7d8e911592..5e1b0fe978 100644 --- a/src/Contracts/Structures/Structure.php +++ b/src/Contracts/Structures/Structure.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Structures; -interface Structure -{ -} +interface Structure {} diff --git a/src/Contracts/Structures/Tree.php b/src/Contracts/Structures/Tree.php index 664c4f8edc..e985086daf 100644 --- a/src/Contracts/Structures/Tree.php +++ b/src/Contracts/Structures/Tree.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Structures; -interface Tree -{ -} +interface Tree {} diff --git a/src/Contracts/Taxonomies/Taxonomy.php b/src/Contracts/Taxonomies/Taxonomy.php index 5f7f5494d4..a1520cdf28 100644 --- a/src/Contracts/Taxonomies/Taxonomy.php +++ b/src/Contracts/Taxonomies/Taxonomy.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Taxonomies; -interface Taxonomy -{ -} +interface Taxonomy {} diff --git a/src/Contracts/Taxonomies/Term.php b/src/Contracts/Taxonomies/Term.php index 5a5e6ec73e..363e175550 100644 --- a/src/Contracts/Taxonomies/Term.php +++ b/src/Contracts/Taxonomies/Term.php @@ -2,6 +2,4 @@ namespace Statamic\Contracts\Taxonomies; -interface Term -{ -} +interface Term {} diff --git a/src/Exceptions/ApiNotFoundException.php b/src/Exceptions/ApiNotFoundException.php index ef9d718d29..b4f6726858 100644 --- a/src/Exceptions/ApiNotFoundException.php +++ b/src/Exceptions/ApiNotFoundException.php @@ -2,6 +2,4 @@ namespace Statamic\Exceptions; -class ApiNotFoundException extends \Exception -{ -} +class ApiNotFoundException extends \Exception {} diff --git a/src/Exceptions/FatalException.php b/src/Exceptions/FatalException.php index 2ccb4149c8..7e5e2b97e5 100644 --- a/src/Exceptions/FatalException.php +++ b/src/Exceptions/FatalException.php @@ -5,6 +5,4 @@ /** * Bad. Stops the application in its tracks. */ -class FatalException extends \Exception -{ -} +class FatalException extends \Exception {} diff --git a/src/Exceptions/FileNotFoundException.php b/src/Exceptions/FileNotFoundException.php index 364ea757ac..fe480e2f12 100644 --- a/src/Exceptions/FileNotFoundException.php +++ b/src/Exceptions/FileNotFoundException.php @@ -5,6 +5,4 @@ /** * When a file is not found. */ -class FileNotFoundException extends \Exception -{ -} +class FileNotFoundException extends \Exception {} diff --git a/src/Exceptions/InvalidEntryTypeException.php b/src/Exceptions/InvalidEntryTypeException.php index b053167043..60c1763064 100644 --- a/src/Exceptions/InvalidEntryTypeException.php +++ b/src/Exceptions/InvalidEntryTypeException.php @@ -6,6 +6,4 @@ * When an action for one type of entry is performed on another. * For example, trying to access the date of an entry when it is ordered numerically. */ -class InvalidEntryTypeException extends \Exception -{ -} +class InvalidEntryTypeException extends \Exception {} diff --git a/src/Exceptions/MethodNotFoundException.php b/src/Exceptions/MethodNotFoundException.php index 6ab8e02e82..6e0aedf76d 100644 --- a/src/Exceptions/MethodNotFoundException.php +++ b/src/Exceptions/MethodNotFoundException.php @@ -5,6 +5,4 @@ /** * A called method doesn't exist. */ -class MethodNotFoundException extends \Exception -{ -} +class MethodNotFoundException extends \Exception {} diff --git a/src/Exceptions/UrlNotFoundException.php b/src/Exceptions/UrlNotFoundException.php index ca60abbd44..b8e7ab57a8 100644 --- a/src/Exceptions/UrlNotFoundException.php +++ b/src/Exceptions/UrlNotFoundException.php @@ -5,6 +5,4 @@ /** * Trigger a 404. */ -class UrlNotFoundException extends \Exception -{ -} +class UrlNotFoundException extends \Exception {} diff --git a/src/Exceptions/UuidExistsException.php b/src/Exceptions/UuidExistsException.php index 6830edcad6..e5757c9a37 100644 --- a/src/Exceptions/UuidExistsException.php +++ b/src/Exceptions/UuidExistsException.php @@ -2,6 +2,4 @@ namespace Statamic\Exceptions; -class UuidExistsException extends \Exception -{ -} +class UuidExistsException extends \Exception {} diff --git a/src/Fields/Value.php b/src/Fields/Value.php index 2674930a9d..9106e4fb32 100644 --- a/src/Fields/Value.php +++ b/src/Fields/Value.php @@ -93,7 +93,7 @@ public function antlersValue(Parser $parser, $variables) if ($shouldParseAntlers) { if (config('statamic.antlers.version') === 'runtime') { - $value = (new DocumentTransformer())->correct($value); + $value = (new DocumentTransformer)->correct($value); } return $parser->parse($value, $variables); diff --git a/src/Forms/Fieldtype.php b/src/Forms/Fieldtype.php index 384f8d5dac..4af0810bff 100644 --- a/src/Forms/Fieldtype.php +++ b/src/Forms/Fieldtype.php @@ -78,7 +78,7 @@ protected function toItemArray($id, $site = null) public function getIndexItems($request) { - $query = (new ItemQueryBuilder()) + $query = (new ItemQueryBuilder) ->withItems(new DataCollection(Facades\Form::all())); if ($search = $request->search) { diff --git a/src/Git/CommitJob.php b/src/Git/CommitJob.php index 726443d76b..256d8bce65 100644 --- a/src/Git/CommitJob.php +++ b/src/Git/CommitJob.php @@ -15,9 +15,7 @@ class CommitJob implements ShouldQueue /** * Create a new job instance. */ - public function __construct(public $message = null, public $committer = null) - { - } + public function __construct(public $message = null, public $committer = null) {} /** * Execute the job. diff --git a/src/Globals/GlobalCollection.php b/src/Globals/GlobalCollection.php index 2c14be34b2..ad20946269 100644 --- a/src/Globals/GlobalCollection.php +++ b/src/Globals/GlobalCollection.php @@ -4,6 +4,4 @@ use Statamic\Data\DataCollection; -class GlobalCollection extends DataCollection -{ -} +class GlobalCollection extends DataCollection {} diff --git a/src/Globals/VariablesCollection.php b/src/Globals/VariablesCollection.php index 5abc90d0d5..08c39ecc86 100644 --- a/src/Globals/VariablesCollection.php +++ b/src/Globals/VariablesCollection.php @@ -4,6 +4,4 @@ use Statamic\Data\DataCollection; -class VariablesCollection extends DataCollection -{ -} +class VariablesCollection extends DataCollection {} diff --git a/src/GraphQL/Types/ArrayType.php b/src/GraphQL/Types/ArrayType.php index cdf8a13d3a..ebbbaccd22 100644 --- a/src/GraphQL/Types/ArrayType.php +++ b/src/GraphQL/Types/ArrayType.php @@ -28,6 +28,6 @@ public function parseLiteral(Node $valueNode, ?array $variables = null) public function toType(): Type { - return new static(); + return new static; } } diff --git a/src/Imaging/AssetNotFoundException.php b/src/Imaging/AssetNotFoundException.php index fa025afba1..e6c1e17fe6 100644 --- a/src/Imaging/AssetNotFoundException.php +++ b/src/Imaging/AssetNotFoundException.php @@ -2,6 +2,4 @@ namespace Statamic\Imaging; -class AssetNotFoundException extends \Exception -{ -} +class AssetNotFoundException extends \Exception {} diff --git a/src/Imaging/GuzzleAdapter.php b/src/Imaging/GuzzleAdapter.php index 867320ac4f..9558d13754 100644 --- a/src/Imaging/GuzzleAdapter.php +++ b/src/Imaging/GuzzleAdapter.php @@ -43,7 +43,7 @@ class GuzzleAdapter implements FilesystemAdapter public function __construct($base, ?ClientInterface $client = null) { $this->base = rtrim($base, '/').'/'; - $this->client = $client ?: new Client(); + $this->client = $client ?: new Client; } public function fileExists(string $location): bool diff --git a/src/Imaging/ResponseFactory.php b/src/Imaging/ResponseFactory.php index 40e33c0271..e680e6cb25 100644 --- a/src/Imaging/ResponseFactory.php +++ b/src/Imaging/ResponseFactory.php @@ -36,7 +36,7 @@ public function create($cache, $path) { $stream = $cache->readStream($path); - $response = new StreamedResponse(); + $response = new StreamedResponse; $response->headers->set('Content-Type', $cache->mimeType($path)); $response->headers->set('Content-Length', $cache->fileSize($path)); $response->setPublic(); diff --git a/src/Modifiers/CoreModifiers.php b/src/Modifiers/CoreModifiers.php index 1b1cf546cb..3288d074d4 100644 --- a/src/Modifiers/CoreModifiers.php +++ b/src/Modifiers/CoreModifiers.php @@ -253,7 +253,7 @@ public function bardHtml($value) $items = array_values(Arr::where($value, fn ($item) => $item['type'] !== 'set')); - return (new Augmentor(new Bard()))->augment($items); + return (new Augmentor(new Bard))->augment($items); } public function boolString($value) diff --git a/src/OAuth/Provider.php b/src/OAuth/Provider.php index 17d69b8d5b..fa0c9aabf5 100644 --- a/src/OAuth/Provider.php +++ b/src/OAuth/Provider.php @@ -22,8 +22,7 @@ class Provider public function __construct( protected string $name, protected array $config = [] - ) { - } + ) {} public function getSocialiteUser() { diff --git a/src/Providers/BardServiceProvider.php b/src/Providers/BardServiceProvider.php index de5921b4ce..a7caf958ae 100644 --- a/src/Providers/BardServiceProvider.php +++ b/src/Providers/BardServiceProvider.php @@ -10,41 +10,41 @@ class BardServiceProvider extends ServiceProvider public function boot() { Augmentor::addExtensions([ - 'blockquote' => new \Tiptap\Nodes\Blockquote(), - 'bold' => new \Tiptap\Marks\Bold(), - 'bulletList' => new \Tiptap\Nodes\BulletList(), - 'code' => new \Tiptap\Marks\Code(), - 'codeBlock' => new \Tiptap\Nodes\CodeBlock(), - 'document' => new \Tiptap\Nodes\Document(), - 'hardBreak' => new \Tiptap\Nodes\HardBreak(), - 'heading' => new \Tiptap\Nodes\Heading(), - 'horizontalRule' => new \Tiptap\Nodes\HorizontalRule(), + 'blockquote' => new \Tiptap\Nodes\Blockquote, + 'bold' => new \Tiptap\Marks\Bold, + 'bulletList' => new \Tiptap\Nodes\BulletList, + 'code' => new \Tiptap\Marks\Code, + 'codeBlock' => new \Tiptap\Nodes\CodeBlock, + 'document' => new \Tiptap\Nodes\Document, + 'hardBreak' => new \Tiptap\Nodes\HardBreak, + 'heading' => new \Tiptap\Nodes\Heading, + 'horizontalRule' => new \Tiptap\Nodes\HorizontalRule, 'image' => function ($bard, $options) { return $options['withStatamicImageUrls'] ? new \Statamic\Fieldtypes\Bard\StatamicImageNode : new \Statamic\Fieldtypes\Bard\ImageNode; }, - 'italic' => new \Tiptap\Marks\Italic(), + 'italic' => new \Tiptap\Marks\Italic, 'link' => function ($bard, $options) { return $options['withStatamicImageUrls'] ? new \Statamic\Fieldtypes\Bard\StatamicLinkMark : new \Statamic\Fieldtypes\Bard\LinkMark; }, - 'listItem' => new \Tiptap\Nodes\ListItem(), - 'orderedList' => new \Tiptap\Nodes\OrderedList(), - 'paragraph' => new \Tiptap\Nodes\Paragraph(), - 'set' => new \Statamic\Fieldtypes\Bard\SetNode(), - 'subscript' => new \Tiptap\Marks\Subscript(), - 'superscript' => new \Tiptap\Marks\Superscript(), - 'small' => new \Statamic\Fieldtypes\Bard\Marks\Small(), - 'strike' => new \Tiptap\Marks\Strike(), - 'table' => new \Tiptap\Nodes\Table(), - 'tableCell' => new \Tiptap\Nodes\TableCell(), - 'tableHeader' => new \Tiptap\Nodes\TableHeader(), - 'tableRow' => new \Tiptap\Nodes\TableRow(), - 'text' => new \Tiptap\Nodes\Text(), + 'listItem' => new \Tiptap\Nodes\ListItem, + 'orderedList' => new \Tiptap\Nodes\OrderedList, + 'paragraph' => new \Tiptap\Nodes\Paragraph, + 'set' => new \Statamic\Fieldtypes\Bard\SetNode, + 'subscript' => new \Tiptap\Marks\Subscript, + 'superscript' => new \Tiptap\Marks\Superscript, + 'small' => new \Statamic\Fieldtypes\Bard\Marks\Small, + 'strike' => new \Tiptap\Marks\Strike, + 'table' => new \Tiptap\Nodes\Table, + 'tableCell' => new \Tiptap\Nodes\TableCell, + 'tableHeader' => new \Tiptap\Nodes\TableHeader, + 'tableRow' => new \Tiptap\Nodes\TableRow, + 'text' => new \Tiptap\Nodes\Text, 'textAlign' => new \Tiptap\Extensions\TextAlign(['types' => ['heading', 'paragraph']]), - 'underline' => new \Tiptap\Marks\Underline(), + 'underline' => new \Tiptap\Marks\Underline, ]); } } diff --git a/src/Providers/FilesystemServiceProvider.php b/src/Providers/FilesystemServiceProvider.php index 04e0f75865..366f0734ac 100644 --- a/src/Providers/FilesystemServiceProvider.php +++ b/src/Providers/FilesystemServiceProvider.php @@ -15,7 +15,7 @@ public function register() }); $this->app->bind(AssetContainerContents::class, function () { - return new AssetContainerContents(); + return new AssetContainerContents; }); $paths = [ diff --git a/src/Providers/ViewServiceProvider.php b/src/Providers/ViewServiceProvider.php index 11064a6f0b..3b73cdd5b4 100644 --- a/src/Providers/ViewServiceProvider.php +++ b/src/Providers/ViewServiceProvider.php @@ -82,7 +82,7 @@ private function registerRuntimeAntlers() } $this->app->bind(EnvironmentDetails::class, function ($app) { - $envDetails = new EnvironmentDetails(); + $envDetails = new EnvironmentDetails; $envDetails->setTagNames($app->make('statamic.tags')->keys()->all()); $envDetails->setModifierNames($app->make('statamic.modifiers')->keys()->all()); @@ -93,17 +93,17 @@ private function registerRuntimeAntlers() }); $this->app->singleton(ModifierManager::class, function ($app) { - return new ModifierManager(); + return new ModifierManager; }); $this->app->singleton(PerformanceTracer::class, function () { - return new PerformanceTracer(); + return new PerformanceTracer; }); $this->app->bind('antlers.runtime', function ($app) { /** @var RuntimeParser $parser */ $parser = $app->make(RuntimeParser::class)->cascade($app[Cascade::class]); - $runtimeConfig = new RuntimeConfiguration(); + $runtimeConfig = new RuntimeConfiguration; $isTracingOn = config('statamic.antlers.tracing', false); $runtimeConfig->fatalErrorOnUnpairedLoop = config('statamic.antlers.fatalErrorOnUnpairedLoop', false); @@ -136,7 +136,7 @@ private function registerRuntimeAntlers() ); if ($isTracingOn) { - $traceManager = new TraceManager(); + $traceManager = new TraceManager; $tracers = config('statamic.antlers.tracers', []); foreach ($tracers as $abstract) { @@ -149,7 +149,7 @@ private function registerRuntimeAntlers() if (GlobalDebugManager::isDebugSessionActive()) { if (! $isTracingOn) { - $runtimeConfig->traceManager = new TraceManager(); + $runtimeConfig->traceManager = new TraceManager; $runtimeConfig->isTracingEnabled = true; } @@ -158,7 +158,7 @@ private function registerRuntimeAntlers() if ($this->profilerEnabled()) { if (! $isTracingOn) { - $runtimeConfig->traceManager = new TraceManager(); + $runtimeConfig->traceManager = new TraceManager; $runtimeConfig->isTracingEnabled = true; } diff --git a/src/Search/Comb/Exceptions/Exception.php b/src/Search/Comb/Exceptions/Exception.php index 835398a8ae..bad346587e 100644 --- a/src/Search/Comb/Exceptions/Exception.php +++ b/src/Search/Comb/Exceptions/Exception.php @@ -5,6 +5,4 @@ /** * Basic Comb exception from which others extend. */ -class Exception extends \Exception -{ -} +class Exception extends \Exception {} diff --git a/src/Search/Comb/Exceptions/NoQuery.php b/src/Search/Comb/Exceptions/NoQuery.php index 2adacda9a0..da14ef945b 100644 --- a/src/Search/Comb/Exceptions/NoQuery.php +++ b/src/Search/Comb/Exceptions/NoQuery.php @@ -5,6 +5,4 @@ /** * Thrown when no query has been asked. */ -class NoQuery extends Exception -{ -} +class NoQuery extends Exception {} diff --git a/src/Search/Comb/Exceptions/NoResultsFound.php b/src/Search/Comb/Exceptions/NoResultsFound.php index e9aa1dfd7d..687d842f23 100644 --- a/src/Search/Comb/Exceptions/NoResultsFound.php +++ b/src/Search/Comb/Exceptions/NoResultsFound.php @@ -5,6 +5,4 @@ /** * Thrown when no results are found. */ -class NoResultsFound extends Exception -{ -} +class NoResultsFound extends Exception {} diff --git a/src/Search/Comb/Exceptions/NotEnoughCharacters.php b/src/Search/Comb/Exceptions/NotEnoughCharacters.php index a5056ff3a7..fb182ebeb4 100644 --- a/src/Search/Comb/Exceptions/NotEnoughCharacters.php +++ b/src/Search/Comb/Exceptions/NotEnoughCharacters.php @@ -5,6 +5,4 @@ /** * Thrown when not enough characters have been entered. */ -class NotEnoughCharacters extends Exception -{ -} +class NotEnoughCharacters extends Exception {} diff --git a/src/Search/Comb/Exceptions/TooManyResults.php b/src/Search/Comb/Exceptions/TooManyResults.php index fb05b2198a..511200285b 100644 --- a/src/Search/Comb/Exceptions/TooManyResults.php +++ b/src/Search/Comb/Exceptions/TooManyResults.php @@ -5,6 +5,4 @@ /** * Thrown when there are more results than the limit. */ -class TooManyResults extends Exception -{ -} +class TooManyResults extends Exception {} diff --git a/src/Search/IndexNotFoundException.php b/src/Search/IndexNotFoundException.php index 613419772e..66f4011ee1 100644 --- a/src/Search/IndexNotFoundException.php +++ b/src/Search/IndexNotFoundException.php @@ -2,6 +2,4 @@ namespace Statamic\Search; -class IndexNotFoundException extends \Exception -{ -} +class IndexNotFoundException extends \Exception {} diff --git a/src/Stache/Exceptions/StoreExpiredException.php b/src/Stache/Exceptions/StoreExpiredException.php index a5f5b95734..0086df4e83 100644 --- a/src/Stache/Exceptions/StoreExpiredException.php +++ b/src/Stache/Exceptions/StoreExpiredException.php @@ -2,6 +2,4 @@ namespace Statamic\Stache\Exceptions; -class StoreExpiredException extends \Exception -{ -} +class StoreExpiredException extends \Exception {} diff --git a/src/Tags/Chunks.php b/src/Tags/Chunks.php index edd7c5995c..bf5d07b47a 100644 --- a/src/Tags/Chunks.php +++ b/src/Tags/Chunks.php @@ -4,6 +4,4 @@ use Illuminate\Support\Collection; -class Chunks extends Collection -{ -} +class Chunks extends Collection {} diff --git a/src/Tags/NotFound.php b/src/Tags/NotFound.php index f4114c1557..26aeecc1b9 100644 --- a/src/Tags/NotFound.php +++ b/src/Tags/NotFound.php @@ -10,6 +10,6 @@ class NotFound extends Tags public function index() { - throw new NotFoundHttpException(); + throw new NotFoundHttpException; } } diff --git a/src/Tags/Structure.php b/src/Tags/Structure.php index bdaecf2708..fa1cb2f00a 100644 --- a/src/Tags/Structure.php +++ b/src/Tags/Structure.php @@ -80,7 +80,7 @@ protected function ensureStructureExists(string $handle): void protected function query($handle) { - $query = new ItemQueryBuilder(); + $query = new ItemQueryBuilder; return Str::startsWith($handle, 'collection::') ? $this->queryForCollection($query) diff --git a/src/Taxonomies/TermCollection.php b/src/Taxonomies/TermCollection.php index 71c143d2df..0bd53c2f30 100644 --- a/src/Taxonomies/TermCollection.php +++ b/src/Taxonomies/TermCollection.php @@ -4,6 +4,4 @@ use Statamic\Data\DataCollection; -class TermCollection extends DataCollection -{ -} +class TermCollection extends DataCollection {} diff --git a/src/View/Antlers/Language/Analyzers/TagIdentifierAnalyzer.php b/src/View/Antlers/Language/Analyzers/TagIdentifierAnalyzer.php index 86df6d411d..f9c08b72fb 100644 --- a/src/View/Antlers/Language/Analyzers/TagIdentifierAnalyzer.php +++ b/src/View/Antlers/Language/Analyzers/TagIdentifierAnalyzer.php @@ -23,7 +23,7 @@ class TagIdentifierAnalyzer */ public static function getIdentifier($input) { - $identifier = new TagIdentifier(); + $identifier = new TagIdentifier; $identifier->content = trim($input); $parts = explode(':', $input); diff --git a/src/View/Antlers/Language/Analyzers/TagPairAnalyzer.php b/src/View/Antlers/Language/Analyzers/TagPairAnalyzer.php index 30026f0233..04c4293842 100644 --- a/src/View/Antlers/Language/Analyzers/TagPairAnalyzer.php +++ b/src/View/Antlers/Language/Analyzers/TagPairAnalyzer.php @@ -383,12 +383,12 @@ public function associate($documentNodes, $document) $node->endPosition->index + 1, $node->isClosedBy->startPosition->index); - $noParseNode = new EscapedContentNode(); + $noParseNode = new EscapedContentNode; $parser = $node->getParser(); $noParseNode->withParser($parser); $node->copyBasicDetailsTo($noParseNode); - $noParseNode->name = new TagIdentifier(); + $noParseNode->name = new TagIdentifier; $noParseNode->name->name = 'noparse'; $noParseNode->name->compound = 'noparse'; @@ -467,7 +467,7 @@ private function reduceConditionals($nodes) if ($node instanceof AntlersNode && $node->isComment == false && $node->name->compound == 'if' && $node->isClosingTag == false && $node->isClosedBy != null) { - $conditionNode = new ConditionNode(); + $conditionNode = new ConditionNode; $conditionNode->index = $node->index; $conditionNode->chain[] = $node->index; @@ -483,7 +483,7 @@ private function reduceConditionals($nodes) /** @var AntlersNode $tail */ $tail = $result[0]; - $executionBranch = new ExecutionBranch(); + $executionBranch = new ExecutionBranch; $executionBranch->head = $node; $executionBranch->tail = $tail; $executionBranch->nodes = $node->children; diff --git a/src/View/Antlers/Language/Exceptions/RuntimeException.php b/src/View/Antlers/Language/Exceptions/RuntimeException.php index d8d6d8f226..d8ad4bbe68 100644 --- a/src/View/Antlers/Language/Exceptions/RuntimeException.php +++ b/src/View/Antlers/Language/Exceptions/RuntimeException.php @@ -2,6 +2,4 @@ namespace Statamic\View\Antlers\Language\Exceptions; -class RuntimeException extends AntlersException -{ -} +class RuntimeException extends AntlersException {} diff --git a/src/View/Antlers/Language/Exceptions/SyntaxErrorException.php b/src/View/Antlers/Language/Exceptions/SyntaxErrorException.php index d0d41c09ea..e344a9d4fc 100644 --- a/src/View/Antlers/Language/Exceptions/SyntaxErrorException.php +++ b/src/View/Antlers/Language/Exceptions/SyntaxErrorException.php @@ -2,6 +2,4 @@ namespace Statamic\View\Antlers\Language\Exceptions; -class SyntaxErrorException extends AntlersException -{ -} +class SyntaxErrorException extends AntlersException {} diff --git a/src/View/Antlers/Language/Exceptions/VariableAccessException.php b/src/View/Antlers/Language/Exceptions/VariableAccessException.php index 6ebbfbadb1..670b1964b9 100644 --- a/src/View/Antlers/Language/Exceptions/VariableAccessException.php +++ b/src/View/Antlers/Language/Exceptions/VariableAccessException.php @@ -2,6 +2,4 @@ namespace Statamic\View\Antlers\Language\Exceptions; -class VariableAccessException extends RuntimeException -{ -} +class VariableAccessException extends RuntimeException {} diff --git a/src/View/Antlers/Language/Lexer/AntlersLexer.php b/src/View/Antlers/Language/Lexer/AntlersLexer.php index e45b2b8423..6d40090a60 100644 --- a/src/View/Antlers/Language/Lexer/AntlersLexer.php +++ b/src/View/Antlers/Language/Lexer/AntlersLexer.php @@ -246,7 +246,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->isParsingString == false) { if ($this->cur == DocumentParser::Punctuation_FullStop && $this->next == DocumentParser::Punctuation_Equals) { - $stringConcat = new StringConcatenationOperator(); + $stringConcat = new StringConcatenationOperator; $stringConcat->startPosition = $node->lexerRelativeOffset($this->currentIndex); $stringConcat->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); $stringConcat->content = '.='; @@ -309,7 +309,7 @@ public function tokenize(AntlersNode $node, $input) } } - $modifierValueNode = new ModifierValueNode(); + $modifierValueNode = new ModifierValueNode; $modifierValueNode->name = $parsedValue; $modifierValueNode->value = $this->adjustValueConsideringWhitespace($parsedValue); $modifierValueNode->startPosition = $node->lexerRelativeOffset($this->currentIndex - mb_strlen($parsedValue)); @@ -360,7 +360,7 @@ public function tokenize(AntlersNode $node, $input) $this->currentContent = []; - $modifierValueNode = new ModifierValueNode(); + $modifierValueNode = new ModifierValueNode; $modifierValueNode->name = $parsedValue; $modifierValueNode->value = $this->adjustValueConsideringWhitespace($parsedValue); $modifierValueNode->startPosition = $node->lexerRelativeOffset($this->currentIndex - mb_strlen($parsedValue)); @@ -386,7 +386,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->isInModifierParameterValue) { $parsedValue = implode($this->currentContent); - $modifierValueNode = new ModifierValueNode(); + $modifierValueNode = new ModifierValueNode; $modifierValueNode->name = $parsedValue; $modifierValueNode->value = $this->adjustValueConsideringWhitespace($parsedValue); $modifierValueNode->startPosition = $node->lexerRelativeOffset($stringStartedOn); @@ -405,7 +405,7 @@ public function tokenize(AntlersNode $node, $input) continue; } - $stringNode = new StringValueNode(); + $stringNode = new StringValueNode; $stringNode->startPosition = $node->lexerRelativeOffset($stringStartedOn); $stringNode->endPosition = $node->lexerRelativeOffset($this->currentIndex); $stringNode->sourceTerminator = $terminator; @@ -482,7 +482,7 @@ public function tokenize(AntlersNode $node, $input) // Check against internal keywords. if ($lowerParsedValue == LanguageKeywords::LogicalAnd) { - $logicalAnd = new LogicalAndOperator(); + $logicalAnd = new LogicalAndOperator; $logicalAnd->content = LanguageKeywords::LogicalAnd; $logicalAnd->startPosition = $startPosition; $logicalAnd->endPosition = $endPosition; @@ -492,7 +492,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($lowerParsedValue == LanguageKeywords::LogicalOr) { - $logicalOr = new LogicalOrOperator(); + $logicalOr = new LogicalOrOperator; $logicalOr->content = LanguageKeywords::LogicalOr; $logicalOr->startPosition = $startPosition; $logicalOr->endPosition = $endPosition; @@ -502,7 +502,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($lowerParsedValue == LanguageKeywords::LogicalXor) { - $logicalXor = new LogicalXorOperator(); + $logicalXor = new LogicalXorOperator; $logicalXor->content = LanguageKeywords::LogicalXor; $logicalXor->startPosition = $startPosition; $logicalXor->endPosition = $endPosition; @@ -512,7 +512,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($lowerParsedValue == LanguageKeywords::ConstNull) { - $constNull = new NullConstant(); + $constNull = new NullConstant; $constNull->content = LanguageKeywords::ConstNull; $constNull->startPosition = $startPosition; $constNull->endPosition = $endPosition; @@ -522,7 +522,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($lowerParsedValue == LanguageKeywords::ConstTrue) { - $constTrue = new TrueConstant(); + $constTrue = new TrueConstant; $constTrue->content = LanguageKeywords::ConstTrue; $constTrue->startPosition = $startPosition; $constTrue->endPosition = $endPosition; @@ -532,7 +532,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($lowerParsedValue == LanguageKeywords::ConstFalse) { - $constFalse = new FalseConstant(); + $constFalse = new FalseConstant; $constFalse->content = LanguageKeywords::ConstFalse; $constFalse->startPosition = $startPosition; $constFalse->endPosition = $endPosition; @@ -542,7 +542,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($lowerParsedValue == LanguageKeywords::LogicalNot) { - $logicNegation = new LogicalNegationOperator(); + $logicNegation = new LogicalNegationOperator; $logicNegation->content = LanguageKeywords::LogicalNot; $logicNegation->startPosition = $startPosition; $logicNegation->endPosition = $endPosition; @@ -552,7 +552,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($parsedValue == LanguageKeywords::ArrList && $this->next == DocumentParser::LeftParen) { - $tupleListStart = new TupleListStart(); + $tupleListStart = new TupleListStart; $tupleListStart->content = LanguageKeywords::ArrList; $tupleListStart->startPosition = $startPosition; $tupleListStart->endPosition = $endPosition; @@ -564,7 +564,7 @@ public function tokenize(AntlersNode $node, $input) } if (is_numeric($parsedValue)) { - $numberNode = new NumberNode(); + $numberNode = new NumberNode; $numberNode->startPosition = $startPosition; $numberNode->endPosition = $endPosition; @@ -585,7 +585,7 @@ public function tokenize(AntlersNode $node, $input) $lastValue = $this->runtimeNodes[count($this->runtimeNodes) - 1]; if ($lastValue instanceof ModifierSeparator) { - $modifierNameNode = new ModifierNameNode(); + $modifierNameNode = new ModifierNameNode; $modifierNameNode->name = $parsedValue; $modifierNameNode->startPosition = $startPosition; $modifierNameNode->endPosition = $endPosition; @@ -594,7 +594,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($lastValue instanceof ModifierValueSeparator) { - $modifierValueNode = new ModifierValueNode(); + $modifierValueNode = new ModifierValueNode; $modifierValueNode->name = $parsedValue; $modifierValueNode->value = $parsedValue; $modifierValueNode->startPosition = $startPosition; @@ -609,7 +609,7 @@ public function tokenize(AntlersNode $node, $input) } if ($parsedValue == DocumentParser::Punctuation_Minus) { - $subtractionOperator = new SubtractionOperator(); + $subtractionOperator = new SubtractionOperator; $subtractionOperator->content = '-'; $subtractionOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $subtractionOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -617,7 +617,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $subtractionOperator; $this->lastNode = $subtractionOperator; } else { - $variableRefNode = new VariableNode(); + $variableRefNode = new VariableNode; $variableRefNode->name = $parsedValue; $variableRefNode->startPosition = $startPosition; $variableRefNode->endPosition = $endPosition; @@ -639,7 +639,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->isParsingString == false) { if ($this->cur == DocumentParser::Punctuation_Equals && $this->next == DocumentParser::Punctuation_GreaterThan) { - $scopeAssignment = new ScopeAssignmentOperator(); + $scopeAssignment = new ScopeAssignmentOperator; $scopeAssignment->content = '=>'; $scopeAssignment->startPosition = $node->lexerRelativeOffset($this->currentIndex); $scopeAssignment->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -654,7 +654,7 @@ public function tokenize(AntlersNode $node, $input) // , if ($this->cur == DocumentParser::Punctuation_Comma) { - $argSeparator = new ArgSeparator(); + $argSeparator = new ArgSeparator; $argSeparator->content = DocumentParser::Punctuation_Comma; $argSeparator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $argSeparator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -667,7 +667,7 @@ public function tokenize(AntlersNode $node, $input) // ; if ($this->cur == DocumentParser::Punctuation_Semicolon) { - $statementSeparator = new StatementSeparatorNode(); + $statementSeparator = new StatementSeparatorNode; $statementSeparator->content = DocumentParser::Punctuation_Semicolon; $statementSeparator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $statementSeparator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -681,7 +681,7 @@ public function tokenize(AntlersNode $node, $input) // + if ($this->cur == DocumentParser::Punctuation_Plus) { if ($this->next == DocumentParser::Punctuation_Equals) { - $additionAssignment = new AdditionAssignmentOperator(); + $additionAssignment = new AdditionAssignmentOperator; $additionAssignment->content = '+='; $additionAssignment->startPosition = $node->lexerRelativeOffset($this->currentIndex); $additionAssignment->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -693,7 +693,7 @@ public function tokenize(AntlersNode $node, $input) continue; } - $additionOperator = new AdditionOperator(); + $additionOperator = new AdditionOperator; $additionOperator->content = '+'; $additionOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $additionOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -715,7 +715,7 @@ public function tokenize(AntlersNode $node, $input) } if ($this->next == DocumentParser::Punctuation_Equals) { - $subtractionAssignment = new SubtractionAssignmentOperator(); + $subtractionAssignment = new SubtractionAssignmentOperator; $subtractionAssignment->content = '-='; $subtractionAssignment->startPosition = $node->lexerRelativeOffset($this->currentIndex); $subtractionAssignment->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -726,7 +726,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($this->next == DocumentParser::Punctuation_GreaterThan) { - $methodInvocation = new MethodInvocationNode(); + $methodInvocation = new MethodInvocationNode; $methodInvocation->content = '->'; $methodInvocation->startPosition = $node->lexerRelativeOffset($this->currentIndex); $methodInvocation->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -738,7 +738,7 @@ public function tokenize(AntlersNode $node, $input) continue; } - $subtractionOperator = new SubtractionOperator(); + $subtractionOperator = new SubtractionOperator; $subtractionOperator->content = '-'; $subtractionOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $subtractionOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -752,7 +752,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->cur == DocumentParser::Punctuation_Asterisk) { // ** if ($this->next == DocumentParser::Punctuation_Asterisk) { - $exponentiationOperator = new ExponentiationOperator(); + $exponentiationOperator = new ExponentiationOperator; $exponentiationOperator->content = '**'; $exponentiationOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $exponentiationOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -763,7 +763,7 @@ public function tokenize(AntlersNode $node, $input) continue; } elseif ($this->next == DocumentParser::Punctuation_Equals) { - $multiplicationAssignment = new MultiplicationAssignmentOperator(); + $multiplicationAssignment = new MultiplicationAssignmentOperator; $multiplicationAssignment->content = '*='; $multiplicationAssignment->startPosition = $node->lexerRelativeOffset($this->currentIndex); $multiplicationAssignment->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -776,7 +776,7 @@ public function tokenize(AntlersNode $node, $input) } // * - $multiplicationOperator = new MultiplicationOperator(); + $multiplicationOperator = new MultiplicationOperator; $multiplicationOperator->content = '*'; $multiplicationOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $multiplicationOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -790,7 +790,7 @@ public function tokenize(AntlersNode $node, $input) // / if ($this->cur == DocumentParser::Punctuation_ForwardSlash) { if ($this->next == DocumentParser::Punctuation_Equals) { - $divisionAssignment = new DivisionAssignmentOperator(); + $divisionAssignment = new DivisionAssignmentOperator; $divisionAssignment->content = '/='; $divisionAssignment->startPosition = $node->lexerRelativeOffset($this->currentIndex); $divisionAssignment->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -802,7 +802,7 @@ public function tokenize(AntlersNode $node, $input) continue; } - $divisionOperator = new DivisionOperator(); + $divisionOperator = new DivisionOperator; $divisionOperator->content = '/'; $divisionOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $divisionOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -816,7 +816,7 @@ public function tokenize(AntlersNode $node, $input) // % if ($this->cur == DocumentParser::Punctuation_Percent) { if ($this->next == DocumentParser::Punctuation_Equals) { - $modulusAssignment = new ModulusAssignmentOperator(); + $modulusAssignment = new ModulusAssignmentOperator; $modulusAssignment->content = '%='; $modulusAssignment->startPosition = $node->lexerRelativeOffset($this->currentIndex); $modulusAssignment->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -828,7 +828,7 @@ public function tokenize(AntlersNode $node, $input) continue; } - $modulusOperator = new ModulusOperator(); + $modulusOperator = new ModulusOperator; $modulusOperator->content = '%'; $modulusOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $modulusOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -849,7 +849,7 @@ public function tokenize(AntlersNode $node, $input) // <=> if ($peek == DocumentParser::Punctuation_GreaterThan) { - $spaceshipOperator = new SpaceshipCompOperator(); + $spaceshipOperator = new SpaceshipCompOperator; $spaceshipOperator->content = '<=>'; $spaceshipOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $spaceshipOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 3); @@ -862,7 +862,7 @@ public function tokenize(AntlersNode $node, $input) } // <= - $lessThanEqual = new LessThanEqualCompOperator(); + $lessThanEqual = new LessThanEqualCompOperator; $lessThanEqual->content = '<='; $lessThanEqual->startPosition = $node->lexerRelativeOffset($this->currentIndex); $lessThanEqual->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -875,7 +875,7 @@ public function tokenize(AntlersNode $node, $input) } // < - $lessThan = new LessThanCompOperator(); + $lessThan = new LessThanCompOperator; $lessThan->content = '<'; $lessThan->startPosition = $node->lexerRelativeOffset($this->currentIndex); $lessThan->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -889,7 +889,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->cur == DocumentParser::Punctuation_GreaterThan) { // >= if ($this->next == DocumentParser::Punctuation_Equals) { - $greaterThanEqual = new GreaterThanEqualCompOperator(); + $greaterThanEqual = new GreaterThanEqualCompOperator; $greaterThanEqual->content = '>='; $greaterThanEqual->startPosition = $node->lexerRelativeOffset($this->currentIndex); $greaterThanEqual->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -901,7 +901,7 @@ public function tokenize(AntlersNode $node, $input) continue; } - $greaterThan = new GreaterThanCompOperator(); + $greaterThan = new GreaterThanCompOperator; $greaterThan->content = '>'; $greaterThan->startPosition = $node->lexerRelativeOffset($this->currentIndex); $greaterThan->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -913,7 +913,7 @@ public function tokenize(AntlersNode $node, $input) } if ($this->cur == DocumentParser::Punctuation_Equals && $this->next != DocumentParser::Punctuation_Equals) { - $leftAssignment = new LeftAssignmentOperator(); + $leftAssignment = new LeftAssignmentOperator; $leftAssignment->content = '='; $leftAssignment->startPosition = $node->lexerRelativeOffset($this->currentIndex); $leftAssignment->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -933,7 +933,7 @@ public function tokenize(AntlersNode $node, $input) if ($peek == DocumentParser::Punctuation_Equals) { // === - $strictEqual = new StrictEqualCompOperator(); + $strictEqual = new StrictEqualCompOperator; $strictEqual->content = '==='; $strictEqual->startPosition = $node->lexerRelativeOffset($this->currentIndex); $strictEqual->endPosition = $node->lexerRelativeOffset($this->currentIndex + 3); @@ -943,7 +943,7 @@ public function tokenize(AntlersNode $node, $input) $this->currentIndex += 2; } else { // == - $equalOperator = new EqualCompOperator(); + $equalOperator = new EqualCompOperator; $equalOperator->content = '=='; $equalOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $equalOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -959,7 +959,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->cur == DocumentParser::Punctuation_Ampersand) { // && if ($this->next == DocumentParser::Punctuation_Ampersand) { - $logicalAnd = new LogicalAndOperator(); + $logicalAnd = new LogicalAndOperator; $logicalAnd->content = '&&'; $logicalAnd->startPosition = $node->lexerRelativeOffset($this->currentIndex); $logicalAnd->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -972,7 +972,7 @@ public function tokenize(AntlersNode $node, $input) } if ($this->next == DocumentParser::Punctuation_Equals) { - $concatOperator = new StringConcatenationOperator(); + $concatOperator = new StringConcatenationOperator; $concatOperator->content = '&='; $concatOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $concatOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -984,7 +984,7 @@ public function tokenize(AntlersNode $node, $input) continue; } - $logicalAnd = new LogicalAndOperator(); + $logicalAnd = new LogicalAndOperator; $logicalAnd->content = '&'; $logicalAnd->startPosition = $node->lexerRelativeOffset($this->currentIndex); $logicalAnd->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -996,7 +996,7 @@ public function tokenize(AntlersNode $node, $input) } if ($this->cur == DocumentParser::Punctuation_Pipe && $this->next != DocumentParser::Punctuation_Pipe) { - $modifierSeparator = new ModifierSeparator(); + $modifierSeparator = new ModifierSeparator; $modifierSeparator->content = '|'; $modifierSeparator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $modifierSeparator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -1011,7 +1011,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->cur == DocumentParser::Punctuation_Pipe && $this->next == DocumentParser::Punctuation_Pipe) { // || - $logicalOr = new LogicalOrOperator(); + $logicalOr = new LogicalOrOperator; $logicalOr->content = '||'; $logicalOr->startPosition = $node->lexerRelativeOffset($this->currentIndex); $logicalOr->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -1033,7 +1033,7 @@ public function tokenize(AntlersNode $node, $input) if ($peek == DocumentParser::Punctuation_Equals) { // !== - $strictNotEqual = new NotStrictEqualCompOperator(); + $strictNotEqual = new NotStrictEqualCompOperator; $strictNotEqual->content = '!=='; $strictNotEqual->startPosition = $node->lexerRelativeOffset($this->currentIndex); $strictNotEqual->endPosition = $node->lexerRelativeOffset($this->currentIndex + 3); @@ -1046,7 +1046,7 @@ public function tokenize(AntlersNode $node, $input) } // != - $notEqual = new NotEqualCompOperator(); + $notEqual = new NotEqualCompOperator; $notEqual->content = '!='; $notEqual->startPosition = $node->lexerRelativeOffset($this->currentIndex); $notEqual->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -1059,7 +1059,7 @@ public function tokenize(AntlersNode $node, $input) } // ! - $logicalNot = new LogicalNegationOperator(); + $logicalNot = new LogicalNegationOperator; $logicalNot->content = '!'; $logicalNot->startPosition = $node->lexerRelativeOffset($this->currentIndex); $logicalNot->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -1072,7 +1072,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->cur == DocumentParser::Punctuation_Question && $this->next == DocumentParser::Punctuation_Equals) { // ?= - $conditionalFallback = new ConditionalVariableFallbackOperator(); + $conditionalFallback = new ConditionalVariableFallbackOperator; $conditionalFallback->content = '?='; $conditionalFallback->startPosition = $node->lexerRelativeOffset($this->currentIndex); $conditionalFallback->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -1086,7 +1086,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->cur == DocumentParser::Punctuation_Question && $this->next == DocumentParser::Punctuation_Question) { // ?? - $nullCoalesceOperator = new NullCoalesceOperator(); + $nullCoalesceOperator = new NullCoalesceOperator; $nullCoalesceOperator->content = '??'; $nullCoalesceOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $nullCoalesceOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -1100,7 +1100,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->cur == DocumentParser::Punctuation_Question && $this->next == DocumentParser::Punctuation_Colon) { // ?: - $nullCoalesceOperator = new NullCoalesceOperator(); + $nullCoalesceOperator = new NullCoalesceOperator; $nullCoalesceOperator->content = '?:'; $nullCoalesceOperator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $nullCoalesceOperator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 2); @@ -1114,7 +1114,7 @@ public function tokenize(AntlersNode $node, $input) if ($this->cur == DocumentParser::Punctuation_Question) { // ? - $ternarySeparator = new InlineTernarySeparator(); + $ternarySeparator = new InlineTernarySeparator; $ternarySeparator->content = '?'; $ternarySeparator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $ternarySeparator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -1126,7 +1126,7 @@ public function tokenize(AntlersNode $node, $input) } if ($this->cur == DocumentParser::LeftParen) { - $logicalGroupBegin = new LogicGroupBegin(); + $logicalGroupBegin = new LogicGroupBegin; $logicalGroupBegin->content = '('; $logicalGroupBegin->startPosition = $node->lexerRelativeOffset($this->currentIndex); $logicalGroupBegin->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -1138,7 +1138,7 @@ public function tokenize(AntlersNode $node, $input) } if ($this->cur == DocumentParser::RightParent) { - $logicalGroupEnd = new LogicGroupEnd(); + $logicalGroupEnd = new LogicGroupEnd; $logicalGroupEnd->content = ')'; $logicalGroupEnd->startPosition = $node->lexerRelativeOffset($this->currentIndex); $logicalGroupEnd->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -1154,7 +1154,7 @@ public function tokenize(AntlersNode $node, $input) $lastItem = $this->runtimeNodes[count($this->runtimeNodes) - 1]; if ($lastItem instanceof ModifierNameNode) { - $modifierValueSeparator = new ModifierValueSeparator(); + $modifierValueSeparator = new ModifierValueSeparator; $modifierValueSeparator->content = ':'; $modifierValueSeparator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $modifierValueSeparator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -1185,7 +1185,7 @@ public function tokenize(AntlersNode $node, $input) continue; } - $branchSeparator = new InlineBranchSeparator(); + $branchSeparator = new InlineBranchSeparator; $branchSeparator->content = ':'; $branchSeparator->startPosition = $node->lexerRelativeOffset($this->currentIndex); $branchSeparator->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -1198,7 +1198,7 @@ public function tokenize(AntlersNode $node, $input) } if ($this->cur == DocumentParser::LeftBracket) { - $implicitArrayBegin = new ImplicitArrayBegin(); + $implicitArrayBegin = new ImplicitArrayBegin; $implicitArrayBegin->content = '['; $implicitArrayBegin->startPosition = $node->lexerRelativeOffset($this->currentIndex); $implicitArrayBegin->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); @@ -1210,7 +1210,7 @@ public function tokenize(AntlersNode $node, $input) } if ($this->cur == DocumentParser::RightBracket) { - $implicitArrayEnd = new ImplicitArrayEnd(); + $implicitArrayEnd = new ImplicitArrayEnd; $implicitArrayEnd->content = ']'; $implicitArrayEnd->startPosition = $node->lexerRelativeOffset($this->currentIndex); $implicitArrayEnd->endPosition = $node->lexerRelativeOffset($this->currentIndex + 1); diff --git a/src/View/Antlers/Language/Nodes/AntlersNode.php b/src/View/Antlers/Language/Nodes/AntlersNode.php index 86241e6901..7b1c35e46b 100644 --- a/src/View/Antlers/Language/Nodes/AntlersNode.php +++ b/src/View/Antlers/Language/Nodes/AntlersNode.php @@ -289,7 +289,7 @@ public function getParser() */ public function copyBasicDetails() { - $copy = new AntlersNode(); + $copy = new AntlersNode; return $this->copyBasicDetailsTo($copy); } @@ -436,11 +436,11 @@ public function getSingleParameterValue(ParameterNode $param, NodeProcessor $pro if ($this->looksLikeAnArray($value) || StringUtilities::containsSymbolicCharacters($pathToParse)) { $value = Antlers::parser()->getVariable($pathToParse, $data, null); } else { - $pathParser = new PathParser(); + $pathParser = new PathParser; $path = $pathParser->parse($pathToParse); $doIntercept = count($path->pathParts) > 1; - $retriever = new PathDataManager(); + $retriever = new PathDataManager; $retriever->setIsPaired(false)->setReduceFinal(false) ->cascade($processor->getCascade()) ->setShouldDoValueIntercept($doIntercept); @@ -505,8 +505,8 @@ public function getModifierParameterValuesForParameter(ParameterNode $param, $da $value = $param->value; if ($param->isVariableReference) { - $pathParser = new PathParser(); - $retriever = new PathDataManager(); + $pathParser = new PathParser; + $retriever = new PathDataManager; $retriever->setIsPaired($this->isClosedBy != null); $value = $retriever->getData($pathParser->parse($value), $data); @@ -631,7 +631,7 @@ public function relativePositionFromOffset($offset, $index) public function lexerRelativeOffset($offset) { if ($this->parser == null) { - $position = new Position(); + $position = new Position; $position->index = $offset; $position->offset = $offset; @@ -654,7 +654,7 @@ public function relativeOffset($offset, $index = null) } if ($this->parser == null) { - $position = new Position(); + $position = new Position; $position->index = $offset; $position->offset = $offset; diff --git a/src/View/Antlers/Language/Nodes/ArithmeticNodeContract.php b/src/View/Antlers/Language/Nodes/ArithmeticNodeContract.php index dcb1102049..77d40d66d7 100644 --- a/src/View/Antlers/Language/Nodes/ArithmeticNodeContract.php +++ b/src/View/Antlers/Language/Nodes/ArithmeticNodeContract.php @@ -2,6 +2,4 @@ namespace Statamic\View\Antlers\Language\Nodes; -interface ArithmeticNodeContract -{ -} +interface ArithmeticNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/AssignmentOperatorNodeContract.php b/src/View/Antlers/Language/Nodes/AssignmentOperatorNodeContract.php index 825f909627..784a16bd23 100644 --- a/src/View/Antlers/Language/Nodes/AssignmentOperatorNodeContract.php +++ b/src/View/Antlers/Language/Nodes/AssignmentOperatorNodeContract.php @@ -2,6 +2,4 @@ namespace Statamic\View\Antlers\Language\Nodes; -interface AssignmentOperatorNodeContract -{ -} +interface AssignmentOperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Constants/FalseConstant.php b/src/View/Antlers/Language/Nodes/Constants/FalseConstant.php index c9c02ff5b7..d614f32668 100644 --- a/src/View/Antlers/Language/Nodes/Constants/FalseConstant.php +++ b/src/View/Antlers/Language/Nodes/Constants/FalseConstant.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class FalseConstant extends AbstractNode -{ -} +class FalseConstant extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Constants/NullConstant.php b/src/View/Antlers/Language/Nodes/Constants/NullConstant.php index ee25a7de10..a91c856996 100644 --- a/src/View/Antlers/Language/Nodes/Constants/NullConstant.php +++ b/src/View/Antlers/Language/Nodes/Constants/NullConstant.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class NullConstant extends AbstractNode -{ -} +class NullConstant extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Constants/TrueConstant.php b/src/View/Antlers/Language/Nodes/Constants/TrueConstant.php index b11bb266e5..a280abdc87 100644 --- a/src/View/Antlers/Language/Nodes/Constants/TrueConstant.php +++ b/src/View/Antlers/Language/Nodes/Constants/TrueConstant.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class TrueConstant extends AbstractNode -{ -} +class TrueConstant extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/LiteralNode.php b/src/View/Antlers/Language/Nodes/LiteralNode.php index befb3e33eb..fced4dcf02 100644 --- a/src/View/Antlers/Language/Nodes/LiteralNode.php +++ b/src/View/Antlers/Language/Nodes/LiteralNode.php @@ -2,6 +2,4 @@ namespace Statamic\View\Antlers\Language\Nodes; -class LiteralNode extends AbstractNode -{ -} +class LiteralNode extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/OperatorNodeContract.php b/src/View/Antlers/Language/Nodes/OperatorNodeContract.php index 0d2926f6e7..502d8ec197 100644 --- a/src/View/Antlers/Language/Nodes/OperatorNodeContract.php +++ b/src/View/Antlers/Language/Nodes/OperatorNodeContract.php @@ -2,6 +2,4 @@ namespace Statamic\View\Antlers\Language\Nodes; -interface OperatorNodeContract -{ -} +interface OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/AdditionOperator.php b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/AdditionOperator.php index 4ee02c6af2..6d9844e89f 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/AdditionOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/AdditionOperator.php @@ -6,6 +6,4 @@ use Statamic\View\Antlers\Language\Nodes\ArithmeticNodeContract; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class AdditionOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract -{ -} +class AdditionOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/DivisionOperator.php b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/DivisionOperator.php index a02c20d3ce..521f38c958 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/DivisionOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/DivisionOperator.php @@ -6,6 +6,4 @@ use Statamic\View\Antlers\Language\Nodes\ArithmeticNodeContract; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class DivisionOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract -{ -} +class DivisionOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/ExponentiationOperator.php b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/ExponentiationOperator.php index 55cffacfd6..b9f556bcae 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/ExponentiationOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/ExponentiationOperator.php @@ -6,6 +6,4 @@ use Statamic\View\Antlers\Language\Nodes\ArithmeticNodeContract; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class ExponentiationOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract -{ -} +class ExponentiationOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/ModulusOperator.php b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/ModulusOperator.php index c6bb953882..e083229a2f 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/ModulusOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/ModulusOperator.php @@ -6,6 +6,4 @@ use Statamic\View\Antlers\Language\Nodes\ArithmeticNodeContract; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class ModulusOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract -{ -} +class ModulusOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/MultiplicationOperator.php b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/MultiplicationOperator.php index 19e018f1cf..9600a91d81 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/MultiplicationOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/MultiplicationOperator.php @@ -6,6 +6,4 @@ use Statamic\View\Antlers\Language\Nodes\ArithmeticNodeContract; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class MultiplicationOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract -{ -} +class MultiplicationOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/SubtractionOperator.php b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/SubtractionOperator.php index 89c2cef457..4e0ceac97d 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Arithmetic/SubtractionOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Arithmetic/SubtractionOperator.php @@ -6,6 +6,4 @@ use Statamic\View\Antlers\Language\Nodes\ArithmeticNodeContract; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class SubtractionOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract -{ -} +class SubtractionOperator extends AbstractNode implements ArithmeticNodeContract, OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Assignment/AdditionAssignmentOperator.php b/src/View/Antlers/Language/Nodes/Operators/Assignment/AdditionAssignmentOperator.php index c5547c4adb..e72daf4b19 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Assignment/AdditionAssignmentOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Assignment/AdditionAssignmentOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\AssignmentOperatorNodeContract; -class AdditionAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract -{ -} +class AdditionAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Assignment/DivisionAssignmentOperator.php b/src/View/Antlers/Language/Nodes/Operators/Assignment/DivisionAssignmentOperator.php index 653ac2d652..cccbf070a4 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Assignment/DivisionAssignmentOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Assignment/DivisionAssignmentOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\AssignmentOperatorNodeContract; -class DivisionAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract -{ -} +class DivisionAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Assignment/LeftAssignmentOperator.php b/src/View/Antlers/Language/Nodes/Operators/Assignment/LeftAssignmentOperator.php index 777bc5963c..ca4732718e 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Assignment/LeftAssignmentOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Assignment/LeftAssignmentOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\AssignmentOperatorNodeContract; -class LeftAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract -{ -} +class LeftAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Assignment/ModulusAssignmentOperator.php b/src/View/Antlers/Language/Nodes/Operators/Assignment/ModulusAssignmentOperator.php index a31396ef74..a19ab4f38d 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Assignment/ModulusAssignmentOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Assignment/ModulusAssignmentOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\AssignmentOperatorNodeContract; -class ModulusAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract -{ -} +class ModulusAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Assignment/MultiplicationAssignmentOperator.php b/src/View/Antlers/Language/Nodes/Operators/Assignment/MultiplicationAssignmentOperator.php index 86ee28884e..a3d8e7f11d 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Assignment/MultiplicationAssignmentOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Assignment/MultiplicationAssignmentOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\AssignmentOperatorNodeContract; -class MultiplicationAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract -{ -} +class MultiplicationAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Assignment/SubtractionAssignmentOperator.php b/src/View/Antlers/Language/Nodes/Operators/Assignment/SubtractionAssignmentOperator.php index 37e1c0797e..d5ad7092cf 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Assignment/SubtractionAssignmentOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Assignment/SubtractionAssignmentOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\AssignmentOperatorNodeContract; -class SubtractionAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract -{ -} +class SubtractionAssignmentOperator extends AbstractNode implements AssignmentOperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/EqualCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/EqualCompOperator.php index b3a3952089..68fadc6b49 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/EqualCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/EqualCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class EqualCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class EqualCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/GreaterThanCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/GreaterThanCompOperator.php index 7227175ee6..596a648773 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/GreaterThanCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/GreaterThanCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class GreaterThanCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class GreaterThanCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/GreaterThanEqualCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/GreaterThanEqualCompOperator.php index 075f279e44..edceb7b1b4 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/GreaterThanEqualCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/GreaterThanEqualCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class GreaterThanEqualCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class GreaterThanEqualCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/LessThanCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/LessThanCompOperator.php index 5102a9a46b..0271d2d4a0 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/LessThanCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/LessThanCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class LessThanCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class LessThanCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/LessThanEqualCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/LessThanEqualCompOperator.php index e154176d65..5cb952b73a 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/LessThanEqualCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/LessThanEqualCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class LessThanEqualCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class LessThanEqualCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/NotEqualCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/NotEqualCompOperator.php index bec8225651..721fa492da 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/NotEqualCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/NotEqualCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class NotEqualCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class NotEqualCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/NotStrictEqualCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/NotStrictEqualCompOperator.php index 0d7eb23122..2efbc517e4 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/NotStrictEqualCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/NotStrictEqualCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class NotStrictEqualCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class NotStrictEqualCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/SpaceshipCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/SpaceshipCompOperator.php index 7a6fcaf666..b310e19a61 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/SpaceshipCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/SpaceshipCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class SpaceshipCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class SpaceshipCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/Comparison/StrictEqualCompOperator.php b/src/View/Antlers/Language/Nodes/Operators/Comparison/StrictEqualCompOperator.php index 147c92474b..12ba247862 100644 --- a/src/View/Antlers/Language/Nodes/Operators/Comparison/StrictEqualCompOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/Comparison/StrictEqualCompOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class StrictEqualCompOperator extends AbstractNode implements OperatorNodeContract -{ -} +class StrictEqualCompOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/ConditionalVariableFallbackOperator.php b/src/View/Antlers/Language/Nodes/Operators/ConditionalVariableFallbackOperator.php index 9d6173c175..9c2cd50789 100644 --- a/src/View/Antlers/Language/Nodes/Operators/ConditionalVariableFallbackOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/ConditionalVariableFallbackOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class ConditionalVariableFallbackOperator extends AbstractNode implements OperatorNodeContract -{ -} +class ConditionalVariableFallbackOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/LanguageOperatorConstruct.php b/src/View/Antlers/Language/Nodes/Operators/LanguageOperatorConstruct.php index 07f46a0d4b..f4d264733c 100644 --- a/src/View/Antlers/Language/Nodes/Operators/LanguageOperatorConstruct.php +++ b/src/View/Antlers/Language/Nodes/Operators/LanguageOperatorConstruct.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class LanguageOperatorConstruct extends AbstractNode implements OperatorNodeContract -{ -} +class LanguageOperatorConstruct extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/LogicalAndOperator.php b/src/View/Antlers/Language/Nodes/Operators/LogicalAndOperator.php index 5fcc6eda96..3592fa2f2e 100644 --- a/src/View/Antlers/Language/Nodes/Operators/LogicalAndOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/LogicalAndOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class LogicalAndOperator extends AbstractNode implements OperatorNodeContract -{ -} +class LogicalAndOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/LogicalNegationOperator.php b/src/View/Antlers/Language/Nodes/Operators/LogicalNegationOperator.php index f914fe533d..2492956f50 100644 --- a/src/View/Antlers/Language/Nodes/Operators/LogicalNegationOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/LogicalNegationOperator.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class LogicalNegationOperator extends AbstractNode -{ -} +class LogicalNegationOperator extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Operators/LogicalOrOperator.php b/src/View/Antlers/Language/Nodes/Operators/LogicalOrOperator.php index 5eb110c8e7..8743600145 100644 --- a/src/View/Antlers/Language/Nodes/Operators/LogicalOrOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/LogicalOrOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class LogicalOrOperator extends AbstractNode implements OperatorNodeContract -{ -} +class LogicalOrOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/LogicalXorOperator.php b/src/View/Antlers/Language/Nodes/Operators/LogicalXorOperator.php index bc4af859b6..2ae2daf702 100644 --- a/src/View/Antlers/Language/Nodes/Operators/LogicalXorOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/LogicalXorOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class LogicalXorOperator extends AbstractNode implements OperatorNodeContract -{ -} +class LogicalXorOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/NullCoalesceOperator.php b/src/View/Antlers/Language/Nodes/Operators/NullCoalesceOperator.php index dd5de57c57..ba8eec3e16 100644 --- a/src/View/Antlers/Language/Nodes/Operators/NullCoalesceOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/NullCoalesceOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class NullCoalesceOperator extends AbstractNode implements OperatorNodeContract -{ -} +class NullCoalesceOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/Operators/ScopeAssignmentOperator.php b/src/View/Antlers/Language/Nodes/Operators/ScopeAssignmentOperator.php index ebac024516..d13e46a740 100644 --- a/src/View/Antlers/Language/Nodes/Operators/ScopeAssignmentOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/ScopeAssignmentOperator.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class ScopeAssignmentOperator extends AbstractNode -{ -} +class ScopeAssignmentOperator extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Operators/StringConcatenationOperator.php b/src/View/Antlers/Language/Nodes/Operators/StringConcatenationOperator.php index 5a13fbf881..47a2b50dd1 100644 --- a/src/View/Antlers/Language/Nodes/Operators/StringConcatenationOperator.php +++ b/src/View/Antlers/Language/Nodes/Operators/StringConcatenationOperator.php @@ -5,6 +5,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; use Statamic\View\Antlers\Language\Nodes\OperatorNodeContract; -class StringConcatenationOperator extends AbstractNode implements OperatorNodeContract -{ -} +class StringConcatenationOperator extends AbstractNode implements OperatorNodeContract {} diff --git a/src/View/Antlers/Language/Nodes/ParserFailNode.php b/src/View/Antlers/Language/Nodes/ParserFailNode.php index e01c5532b3..733be53e97 100644 --- a/src/View/Antlers/Language/Nodes/ParserFailNode.php +++ b/src/View/Antlers/Language/Nodes/ParserFailNode.php @@ -6,7 +6,7 @@ class ParserFailNode extends AntlersNode { public static function makeWithStartPosition(Position $startPosition) { - $newNode = new ParserFailNode(); + $newNode = new ParserFailNode; $newNode->startPosition = $startPosition; $newNode->endPosition = $startPosition; diff --git a/src/View/Antlers/Language/Nodes/Paths/VariableReference.php b/src/View/Antlers/Language/Nodes/Paths/VariableReference.php index a894b50564..8d8f1d8486 100644 --- a/src/View/Antlers/Language/Nodes/Paths/VariableReference.php +++ b/src/View/Antlers/Language/Nodes/Paths/VariableReference.php @@ -76,7 +76,7 @@ public function isComplex() public function getRoot(): VariableReference { if ($this->cachedRoot == null) { - $this->cachedRoot = new VariableReference(); + $this->cachedRoot = new VariableReference; if (count($this->pathParts) == 0) { return $this->cachedRoot; @@ -93,7 +93,7 @@ public function getRoot(): VariableReference */ public function clone() { - $reference = new VariableReference(); + $reference = new VariableReference; $reference->originalContent = $this->originalContent; $reference->normalizedReference = $this->normalizedReference; $reference->isStrictVariableReference = $this->isStrictVariableReference; diff --git a/src/View/Antlers/Language/Nodes/Structures/ArgSeparator.php b/src/View/Antlers/Language/Nodes/Structures/ArgSeparator.php index 9d767ab7df..7b357b536d 100644 --- a/src/View/Antlers/Language/Nodes/Structures/ArgSeparator.php +++ b/src/View/Antlers/Language/Nodes/Structures/ArgSeparator.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class ArgSeparator extends AbstractNode -{ -} +class ArgSeparator extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/ImplicitArrayBegin.php b/src/View/Antlers/Language/Nodes/Structures/ImplicitArrayBegin.php index 24a1d85344..18a25ceffb 100644 --- a/src/View/Antlers/Language/Nodes/Structures/ImplicitArrayBegin.php +++ b/src/View/Antlers/Language/Nodes/Structures/ImplicitArrayBegin.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class ImplicitArrayBegin extends AbstractNode -{ -} +class ImplicitArrayBegin extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/ImplicitArrayEnd.php b/src/View/Antlers/Language/Nodes/Structures/ImplicitArrayEnd.php index c0fd52b355..541c3556b6 100644 --- a/src/View/Antlers/Language/Nodes/Structures/ImplicitArrayEnd.php +++ b/src/View/Antlers/Language/Nodes/Structures/ImplicitArrayEnd.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class ImplicitArrayEnd extends AbstractNode -{ -} +class ImplicitArrayEnd extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/InlineBranchSeparator.php b/src/View/Antlers/Language/Nodes/Structures/InlineBranchSeparator.php index 9b08271453..c6aefdf380 100644 --- a/src/View/Antlers/Language/Nodes/Structures/InlineBranchSeparator.php +++ b/src/View/Antlers/Language/Nodes/Structures/InlineBranchSeparator.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class InlineBranchSeparator extends AbstractNode -{ -} +class InlineBranchSeparator extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/InlineTernarySeparator.php b/src/View/Antlers/Language/Nodes/Structures/InlineTernarySeparator.php index a475911fcd..982b5b7b34 100644 --- a/src/View/Antlers/Language/Nodes/Structures/InlineTernarySeparator.php +++ b/src/View/Antlers/Language/Nodes/Structures/InlineTernarySeparator.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class InlineTernarySeparator extends AbstractNode -{ -} +class InlineTernarySeparator extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/LogicGroupBegin.php b/src/View/Antlers/Language/Nodes/Structures/LogicGroupBegin.php index 242d48f474..913218c1f5 100644 --- a/src/View/Antlers/Language/Nodes/Structures/LogicGroupBegin.php +++ b/src/View/Antlers/Language/Nodes/Structures/LogicGroupBegin.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class LogicGroupBegin extends AbstractNode -{ -} +class LogicGroupBegin extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/LogicGroupEnd.php b/src/View/Antlers/Language/Nodes/Structures/LogicGroupEnd.php index a3906727ea..587c4f6656 100644 --- a/src/View/Antlers/Language/Nodes/Structures/LogicGroupEnd.php +++ b/src/View/Antlers/Language/Nodes/Structures/LogicGroupEnd.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class LogicGroupEnd extends AbstractNode -{ -} +class LogicGroupEnd extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/ModifierSeparator.php b/src/View/Antlers/Language/Nodes/Structures/ModifierSeparator.php index 7ac7f3dc05..3f506c817b 100644 --- a/src/View/Antlers/Language/Nodes/Structures/ModifierSeparator.php +++ b/src/View/Antlers/Language/Nodes/Structures/ModifierSeparator.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class ModifierSeparator extends AbstractNode -{ -} +class ModifierSeparator extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/ModifierValueSeparator.php b/src/View/Antlers/Language/Nodes/Structures/ModifierValueSeparator.php index 3096a8ab0b..bc91a8f727 100644 --- a/src/View/Antlers/Language/Nodes/Structures/ModifierValueSeparator.php +++ b/src/View/Antlers/Language/Nodes/Structures/ModifierValueSeparator.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class ModifierValueSeparator extends AbstractNode -{ -} +class ModifierValueSeparator extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/StatementSeparatorNode.php b/src/View/Antlers/Language/Nodes/Structures/StatementSeparatorNode.php index 8d96da7260..bafb115f6a 100644 --- a/src/View/Antlers/Language/Nodes/Structures/StatementSeparatorNode.php +++ b/src/View/Antlers/Language/Nodes/Structures/StatementSeparatorNode.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class StatementSeparatorNode extends AbstractNode -{ -} +class StatementSeparatorNode extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/TupleList.php b/src/View/Antlers/Language/Nodes/Structures/TupleList.php index e619930010..c3a1802167 100644 --- a/src/View/Antlers/Language/Nodes/Structures/TupleList.php +++ b/src/View/Antlers/Language/Nodes/Structures/TupleList.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class TupleList extends AbstractNode -{ -} +class TupleList extends AbstractNode {} diff --git a/src/View/Antlers/Language/Nodes/Structures/TupleListStart.php b/src/View/Antlers/Language/Nodes/Structures/TupleListStart.php index aab8de1df1..3f123e9f93 100644 --- a/src/View/Antlers/Language/Nodes/Structures/TupleListStart.php +++ b/src/View/Antlers/Language/Nodes/Structures/TupleListStart.php @@ -4,6 +4,4 @@ use Statamic\View\Antlers\Language\Nodes\AbstractNode; -class TupleListStart extends AbstractNode -{ -} +class TupleListStart extends AbstractNode {} diff --git a/src/View/Antlers/Language/Parser/AntlersNodeParser.php b/src/View/Antlers/Language/Parser/AntlersNodeParser.php index 32bf6dc1c3..54eb8ddeb2 100644 --- a/src/View/Antlers/Language/Parser/AntlersNodeParser.php +++ b/src/View/Antlers/Language/Parser/AntlersNodeParser.php @@ -38,8 +38,8 @@ class AntlersNodeParser public function __construct() { - $this->pathParser = new PathParser(); - $this->lexer = new AntlersLexer(); + $this->pathParser = new PathParser; + $this->lexer = new AntlersLexer; } /** @@ -96,10 +96,10 @@ public function parseNode(AntlersNode $node) $nodeContent = rtrim($nodeContent, '*'); $nodeContent = trim(StringUtilities::substr($nodeContent, 13)); - $recursiveNode = new RecursiveNode(); + $recursiveNode = new RecursiveNode; $node->copyBasicDetailsTo($recursiveNode); $recursiveNode->originalNode = $node; - $recursiveNode->name = new TagIdentifier(); + $recursiveNode->name = new TagIdentifier; $recursiveNode->name->name = $nodeContent; $recursiveNode->isNestedRecursive = true; @@ -124,10 +124,10 @@ public function parseNode(AntlersNode $node) $nodeContent = rtrim($nodeContent, '*'); $nodeContent = trim(StringUtilities::substr($nodeContent, 10)); - $recursiveNode = new RecursiveNode(); + $recursiveNode = new RecursiveNode; $node->copyBasicDetailsTo($recursiveNode); $recursiveNode->originalNode = $node; - $recursiveNode->name = new TagIdentifier(); + $recursiveNode->name = new TagIdentifier; $recursiveNode->name->name = $nodeContent; try { @@ -272,7 +272,7 @@ public function parseNode(AntlersNode $node) $parser = $node->getParser(); $replacedNode->withParser($parser); - $replacedNode->name = new TagIdentifier(); + $replacedNode->name = new TagIdentifier; $replacedNode->name->name = 'if'; $replacedNode->name->compound = 'if'; @@ -289,7 +289,7 @@ public function parseNode(AntlersNode $node) $parser = $node->getParser(); $replacedNode->withParser($parser); - $replacedNode->name = new TagIdentifier(); + $replacedNode->name = new TagIdentifier; $replacedNode->name->name = 'if'; $replacedNode->name->compound = 'if'; @@ -313,7 +313,7 @@ public function parseNode(AntlersNode $node) $parser = $node->getParser(); $replacedNode->withParser($parser); - $replacedNode->name = new TagIdentifier(); + $replacedNode->name = new TagIdentifier; $replacedNode->name->name = 'elseif'; $replacedNode->name->compound = 'elseif'; @@ -506,7 +506,7 @@ private function getParameters(AntlersNode $node) $endAt += 1; } - $parameterNode = new ParameterNode(); + $parameterNode = new ParameterNode; $parameterNode->isVariableReference = true; $name = implode('', array_slice($currentChars, 2)); @@ -658,7 +658,7 @@ private function getParameters(AntlersNode $node) $terminator = null; $currentChars = []; - $parameterNode = new ParameterNode(); + $parameterNode = new ParameterNode; if (Str::startsWith($name, DocumentParser::Punctuation_Colon)) { $parameterNode->isVariableReference = true; diff --git a/src/View/Antlers/Language/Parser/DocumentParser.php b/src/View/Antlers/Language/Parser/DocumentParser.php index c001ffb364..11b7136ebb 100644 --- a/src/View/Antlers/Language/Parser/DocumentParser.php +++ b/src/View/Antlers/Language/Parser/DocumentParser.php @@ -118,7 +118,7 @@ class DocumentParser public function __construct() { - $this->nodeParser = new AntlersNodeParser(); + $this->nodeParser = new AntlersNodeParser; } public function getText($start, $end) @@ -202,8 +202,8 @@ public function parseIntermediateText() if ($this->cur == self::LeftBrace && $this->next == self::LeftBrace && $this->prev == self::AtChar) { $this->dumpLiteralNode($this->currentIndex); - $escapeNode = new EscapedContentNode(); - $escapeNode->name = new TagIdentifier(); + $escapeNode = new EscapedContentNode; + $escapeNode->name = new TagIdentifier; $escapeNode->name->name = 'noparse'; $escapeNode->content = '{{'; @@ -407,7 +407,7 @@ public function parse($text) $lastIndex = $indexCount - 1; if ($indexCount == 0) { - $fullDocumentLiteral = new LiteralNode(); + $fullDocumentLiteral = new LiteralNode; $fullDocumentLiteral->isVirtual = $this->isVirtual; $fullDocumentLiteral->content = $this->prepareLiteralContent($this->content); $fullDocumentLiteral->startPosition = $this->positionFromOffset(0, 0); @@ -420,7 +420,7 @@ public function parse($text) if ($i == 0 && $offset > 0) { // Create a literal node representing the start of the document. - $node = new LiteralNode(); + $node = new LiteralNode; $node->isVirtual = $this->isVirtual; $node->content = $this->prepareLiteralContent(StringUtilities::substr($this->content, 0, $offset)); @@ -468,7 +468,7 @@ public function parse($text) $content = $this->prepareLiteralContent(StringUtilities::substr($this->content, $this->lastAntlersNode->endPosition->offset + 1)); if (strlen($content) > 0) { - $node = new LiteralNode(); + $node = new LiteralNode; $node->isVirtual = $this->isVirtual; $node->content = $content; @@ -498,7 +498,7 @@ public function parse($text) $content = StringUtilities::substr($this->content, $spanStart, $spanLen); if (strlen($content) > 0) { - $node = new LiteralNode(); + $node = new LiteralNode; $node->isVirtual = $this->isVirtual; $node->content = $content; @@ -534,7 +534,7 @@ public function parse($text) $finalContent = $this->prepareLiteralContent(StringUtilities::substr($this->content, $literalStart)); if (! strlen($finalContent) == 0) { - $finalLiteral = new LiteralNode(); + $finalLiteral = new LiteralNode; $finalLiteral->isVirtual = $this->isVirtual; $finalLiteral->content = $finalContent; $finalLiteral->startPosition = $this->positionFromOffset($literalStart, $literalStart); @@ -575,7 +575,7 @@ public function parse($text) $thisOffset = $this->currentChunkOffset; $content = StringUtilities::substr($this->content, $literalStartIndex); - $node = new LiteralNode(); + $node = new LiteralNode; $node->isVirtual = $this->isVirtual; $node->content = $this->prepareLiteralContent($content); @@ -597,7 +597,7 @@ public function parse($text) $thisOffset = $this->currentChunkOffset; $content = StringUtilities::substr($this->content, $literalStartIndex); - $node = new LiteralNode(); + $node = new LiteralNode; $node->isVirtual = $this->isVirtual; $node->content = $this->prepareLiteralContent($content); @@ -625,7 +625,7 @@ public function parse($text) $content = StringUtilities::substr($this->content, $literalStartIndex, $literalLength); - $node = new LiteralNode(); + $node = new LiteralNode; $node->isVirtual = $this->isVirtual; $node->content = $this->prepareLiteralContent($content); @@ -644,7 +644,7 @@ public function parse($text) $literalStart = $this->currentIndex + $offset; if ($literalStart < $this->inputLen) { - $node = new LiteralNode(); + $node = new LiteralNode; $node->isVirtual = $this->isVirtual; $node->content = $this->prepareLiteralContent(StringUtilities::substr($this->content, $literalStart)); @@ -670,7 +670,7 @@ public function parse($text) foreach ($this->nodes as $node) { if ($node instanceof AntlersNode && ! empty($node->interpolationRegions)) { foreach ($node->interpolationRegions as $varName => $content) { - $docParser = new DocumentParser(); + $docParser = new DocumentParser; $docParser->setIsInterpolatedParser(true); $parseResults = $docParser->parse($content); @@ -687,7 +687,7 @@ public function parse($text) } } - $tagPairAnalyzer = new TagPairAnalyzer(); + $tagPairAnalyzer = new TagPairAnalyzer; $this->renderNodes = $tagPairAnalyzer->associate($this->nodes, $this); foreach ($this->nodes as $node) { @@ -1075,7 +1075,7 @@ private function scanToEndOfAntlersRegion() private function makeAntlersPhpNode($index, $isEcho) { - $node = new PhpExecutionNode(); + $node = new PhpExecutionNode; $node->isVirtual = $this->isVirtual; $node->isEchoNode = $isEcho; @@ -1116,7 +1116,7 @@ private function makeAntlersPhpNode($index, $isEcho) private function makeAntlersTagNode($index, $isComment) { - $node = new AntlersNode(); + $node = new AntlersNode; $node->isVirtual = $this->isVirtual; @@ -1194,7 +1194,7 @@ private function dumpLiteralNode($index) private function makeLiteralNode($buffer, $startOffset, $currentOffset) { - $node = new LiteralNode(); + $node = new LiteralNode; $node->isVirtual = $this->isVirtual; $node->content = implode('', $buffer); $node->startPosition = $this->positionFromOffset($startOffset, $startOffset); @@ -1257,7 +1257,7 @@ public function positionFromOffset($offset, $index, $isRelativeOffset = false) $charToUse = $details[self::K_CHAR]; } - $position = new Position(); + $position = new Position; $position->index = $index; $position->offset = $offset; diff --git a/src/View/Antlers/Language/Parser/DocumentTransformer.php b/src/View/Antlers/Language/Parser/DocumentTransformer.php index ab47617f4c..11e7859e28 100644 --- a/src/View/Antlers/Language/Parser/DocumentTransformer.php +++ b/src/View/Antlers/Language/Parser/DocumentTransformer.php @@ -13,7 +13,7 @@ class DocumentTransformer public function __construct() { - $this->parser = new DocumentParser(); + $this->parser = new DocumentParser; } public function load($text) diff --git a/src/View/Antlers/Language/Parser/LanguageParser.php b/src/View/Antlers/Language/Parser/LanguageParser.php index 63676535b1..7744d74233 100644 --- a/src/View/Antlers/Language/Parser/LanguageParser.php +++ b/src/View/Antlers/Language/Parser/LanguageParser.php @@ -100,7 +100,7 @@ class LanguageParser public function __construct() { - $this->pathParser = new PathParser(); + $this->pathParser = new PathParser; } public function parse($tokens) @@ -159,19 +159,19 @@ private function rewriteImplicitArraysToKeywordForm($nodes) if ($thisNode instanceof ImplicitArrayBegin) { // Emit the "arr" language operator followed by a LogicGroupBegin. - $arrConstruct = new LanguageOperatorConstruct(); + $arrConstruct = new LanguageOperatorConstruct; $arrConstruct->startPosition = $thisNode->startPosition; $arrConstruct->endPosition = $thisNode->endPosition; $arrConstruct->originalAbstractNode = $thisNode; $arrConstruct->content = LanguageOperatorRegistry::ARR_MAKE; - $logicGroupBegin = new LogicGroupBegin(); + $logicGroupBegin = new LogicGroupBegin; $newNodes[] = $arrConstruct; $newNodes[] = $logicGroupBegin; continue; } elseif ($thisNode instanceof ImplicitArrayEnd) { - $logicGroupEnd = new LogicGroupEnd(); + $logicGroupEnd = new LogicGroupEnd; $newNodes[] = $logicGroupEnd; continue; @@ -196,7 +196,7 @@ private function createLogicGroupsToRemoveMethodInvocationAmbiguity($nodes) /** @var AbstractNode $lastNode */ $lastNode = array_pop($newNodes); - $wrapperGroup = new LogicGroup(); + $wrapperGroup = new LogicGroup; $wrapperGroup->startPosition = $lastNode->startPosition; $wrapperGroup->nodes[] = $lastNode; $wrapperGroup->nodes[] = $thisNode; @@ -271,7 +271,7 @@ private function cleanVariableForMethodInvocation(VariableNode $node) private function convertVariableToNumericNode(VariableNode $node) { - $numericNode = new NumberNode(); + $numericNode = new NumberNode; $numericNode->startPosition = $node->startPosition; $numericNode->endPosition = $node->endPosition; $numericNode->content = $node->name; @@ -321,7 +321,7 @@ public function associateMethodCalls($tokens) } } - $methodInvocation = new MethodInvocationNode(); + $methodInvocation = new MethodInvocationNode; $methodInvocation->startPosition = $thisNode->startPosition; if ($prevNode instanceof InlineBranchSeparator) { @@ -356,11 +356,11 @@ public function associateMethodCalls($tokens) $reductionResult = $this->reduceVariableReferenceForObjectAccessor($prevNode); // Construct a dynamic MethodInvocationNode. - $methodInvocation = new MethodInvocationNode(); + $methodInvocation = new MethodInvocationNode; $methodInvocation->startPosition = $thisNode->startPosition; $methodInvocation->endPosition = $thisNode->endPosition; - $wrappedMethod = new VariableNode(); + $wrappedMethod = new VariableNode; $wrappedMethod->name = $reductionResult[0]; $methodInvocation->startPosition->offset -= $reductionResult[1]; @@ -410,7 +410,7 @@ public function associateMethodCalls($tokens) } } - $methodInvocation = new MethodInvocationNode(); + $methodInvocation = new MethodInvocationNode; $methodInvocation->startPosition = $thisNode->startPosition; $methodInvocation->endPosition = $argGroup->endPosition; $methodInvocation->args = $this->makeArgGroup($argNodes); @@ -462,7 +462,7 @@ public function associateMethodCalls($tokens) } } - $methodInvocation = new MethodInvocationNode(); + $methodInvocation = new MethodInvocationNode; $methodInvocation->startPosition = $thisNode->startPosition; $methodInvocation->endPosition = $argGroup->endPosition; $methodInvocation->args = $this->makeArgGroup($argNodes); @@ -584,7 +584,7 @@ private function createLanguageOperators($tokens) private function convertVarNodeToOperator(VariableNode $variable) { - $operator = new LanguageOperatorConstruct(); + $operator = new LanguageOperatorConstruct; $operator->content = $variable->name; $operator->startPosition = $variable->startPosition; $operator->endPosition = $variable->endPosition; @@ -595,7 +595,7 @@ private function convertVarNodeToOperator(VariableNode $variable) private function convertOperatorToVarNode(LanguageOperatorConstruct $operator) { - $varNodeWrap = new VariableNode(); + $varNodeWrap = new VariableNode; $varNodeWrap->startPosition = $operator->startPosition; $varNodeWrap->endPosition = $operator->endPosition; $varNodeWrap->content = $operator->content; @@ -688,7 +688,7 @@ private function createTupleLists($tokens) } // We will simply convert the tuple list syntax into an array node under the hood. - $arrayNode = new ArrayNode(); + $arrayNode = new ArrayNode; $arrayNode->startPosition = $thisToken->startPosition; $arrayNode->endPosition = $thisToken->startPosition; @@ -709,7 +709,7 @@ private function createTupleLists($tokens) ); } - $nestedArrayNode = new ArrayNode(); + $nestedArrayNode = new ArrayNode; $nestedArrayNode->startPosition = $valueNodeCandidate->startPosition; $valueCandidates = []; @@ -733,7 +733,7 @@ private function createTupleLists($tokens) for ($j = 0; $j < $listValueLength; $j++) { $valueToken = $valueCandidates[$j]; - $namedValueNode = new NameValueNode(); + $namedValueNode = new NameValueNode; $namedValueNode->startPosition = $valueToken->startPosition; $namedValueNode->endPosition = $valueToken->endPosition; $namedValueNode->name = $listNames[$j]; @@ -761,7 +761,7 @@ private function createTupleLists($tokens) private function convertVariableToStringNode(VariableNode $node) { - $wrappedNode = new StringValueNode(); + $wrappedNode = new StringValueNode; $wrappedNode->content = $node->name; $wrappedNode->value = $node->name; $wrappedNode->originalAbstractNode = $node; @@ -877,7 +877,7 @@ private function createOperatorInvocations($tokens) ); } - $orderGroup = new DirectionGroup(); + $orderGroup = new DirectionGroup; $orderGroup->orderClauses = $orderClauses; $orderGroup->startPosition = $orderClauses[0]->directionNode->startPosition; $orderGroup->endPosition = $orderClauses[count($orderClauses) - 1]->directionNode->endPosition; @@ -1039,17 +1039,17 @@ private function createOperatorInvocations($tokens) $subTokens = $expressionNode->nodes; - $switchGroup = new SwitchGroup(); + $switchGroup = new SwitchGroup; - $wrapperGroup = new LogicGroup(); + $wrapperGroup = new LogicGroup; $wrapperGroup->nodes = $firstCondition; $wrapperGroup->startPosition = $wrapperGroup->nodes[0]->startPosition; $wrapperGroup->endPosition = $wrapperGroup->nodes[count($wrapperGroup->nodes) - 1]->endPosition; - $firstCase = new SwitchCase(); + $firstCase = new SwitchCase; $firstCase->condition = $wrapperGroup; - $expWrapper = new LogicGroup(); + $expWrapper = new LogicGroup; $expWrapper->nodes = [array_shift($subTokens)]; $expWrapper->startPosition = $expWrapper->nodes[0]->startPosition; $expWrapper->endPosition = $expWrapper->nodes[count($expWrapper->nodes) - 1]->endPosition; @@ -1086,10 +1086,10 @@ private function createOperatorInvocations($tokens) } if ($next instanceof ScopeAssignmentOperator) { - $newCase = new SwitchCase(); + $newCase = new SwitchCase; $newCase->condition = $thisToken; - $expWrapper = new LogicGroup(); + $expWrapper = new LogicGroup; $expWrapper->nodes = [$subTokens[$c + 2]]; $expWrapper->startPosition = $expWrapper->nodes[0]->startPosition; $expWrapper->endPosition = $expWrapper->nodes[count($expWrapper->nodes) - 1]->endPosition; @@ -1118,7 +1118,7 @@ private function createOperatorInvocations($tokens) } } - $newTokens[] = new NullConstant(); + $newTokens[] = new NullConstant; $newTokens[] = $token; $newTokens[] = $switchGroup; @@ -1151,13 +1151,13 @@ private function createOperatorInvocations($tokens) } if ($nextToken instanceof ScopedLogicGroup) { - array_unshift($subNodes, new ScopeAssignmentOperator()); + array_unshift($subNodes, new ScopeAssignmentOperator); array_unshift($subNodes, $nextToken->scope); } /** @var ListValueNode $values */ $values = $this->getArrayValues($subNodes); - $arrayNode = new ArrayNode(); + $arrayNode = new ArrayNode; $arrayNode->startPosition = $token->startPosition; $valueNodeCount = count($values->values); @@ -1186,7 +1186,7 @@ private function createOperatorInvocations($tokens) private function getArrayValues($nodes) { - $valueNode = new ListValueNode(); + $valueNode = new ListValueNode; $nodeCount = count($nodes); $values = []; @@ -1239,7 +1239,7 @@ private function getArrayValues($nodes) /** @var AbstractNode $keyValue */ $keyValue = $nodes[$i + 2]; - $namedValueNode = new NameValueNode(); + $namedValueNode = new NameValueNode; if (! $this->isValidArrayKeyNode($thisNode)) { throw ErrorFactory::makeSyntaxError( @@ -1262,7 +1262,7 @@ private function getArrayValues($nodes) } if ($next == null || $next instanceof ArgSeparator) { - $namedValueNode = new NameValueNode(); + $namedValueNode = new NameValueNode; $namedValueNode->value = $thisNode; $namedValueNode->startPosition = $thisNode->startPosition; $namedValueNode->endPosition = $thisNode->endPosition; @@ -1297,7 +1297,7 @@ private function isValidArrayKeyNode($node) private function getValues($nodes) { - $valueNode = new ListValueNode(); + $valueNode = new ListValueNode; $nodeCount = count($nodes); $values = []; @@ -1330,10 +1330,10 @@ private function makeGroupByFields($nodes) $fields = []; if ($nodeCount == 1 && $nodes[0] instanceof VariableNode) { - $fieldNode = new GroupByField(); + $fieldNode = new GroupByField; $fieldNode->field = $nodes[0]; - $stringAlias = new StringValueNode(); + $stringAlias = new StringValueNode; $stringAlias->value = $fieldNode->field->name; $stringAlias->startPosition = $fieldNode->field->startPosition; $stringAlias->endPosition = $fieldNode->field->endPosition; @@ -1351,7 +1351,7 @@ private function makeGroupByFields($nodes) } if ($next == null || $next instanceof ArgSeparator) { - $fieldNode = new GroupByField(); + $fieldNode = new GroupByField; if ($i > 0) { $fieldNode->field = $nodes[$i - 1]; $fieldNode->alias = $thisNode; @@ -1363,7 +1363,7 @@ private function makeGroupByFields($nodes) $fieldNode->field = $fieldNode->alias; if ($fieldNode->field instanceof VariableNode) { - $stringAlias = new StringValueNode(); + $stringAlias = new StringValueNode; $stringAlias->value = $fieldNode->field->name; $stringAlias->startPosition = $fieldNode->field->startPosition; $stringAlias->endPosition = $fieldNode->field->endPosition; @@ -1373,7 +1373,7 @@ private function makeGroupByFields($nodes) if ($fieldNode->alias instanceof StringValueNode == false) { if ($fieldNode->alias == null && $fieldNode->field instanceof VariableNode) { - $stringAlias = new StringValueNode(); + $stringAlias = new StringValueNode; $stringAlias->value = $fieldNode->field->name; $stringAlias->startPosition = $fieldNode->field->startPosition; $stringAlias->endPosition = $fieldNode->field->endPosition; @@ -1396,7 +1396,7 @@ private function makeGroupByFields($nodes) } } - $fieldStructure = new FieldsNode(); + $fieldStructure = new FieldsNode; $fieldStructure->fields = $fields; return $fieldStructure; @@ -1426,7 +1426,7 @@ private function makeOrderGroup($nodes) if ($i > 0) { if ($next == null || $next instanceof ArgSeparator) { $orderCount += 1; - $orderNode = new ValueDirectionNode(); + $orderNode = new ValueDirectionNode; $orderNode->order = $orderCount; $orderNode->name = $nodes[$i - 1]; $orderNode->directionNode = $thisNode; @@ -1469,7 +1469,7 @@ private function makeOrderGroup($nodes) */ private function makeArgGroup($nodes) { - $argGroup = new ArgumentGroup(); + $argGroup = new ArgumentGroup; $nodeCount = count($nodes); for ($i = 0; $i < $nodeCount; $i++) { @@ -1504,7 +1504,7 @@ private function makeArgGroup($nodes) } $valueNode = $nodes[$i + 2]; - $namedArgument = new NamedArgumentNode(); + $namedArgument = new NamedArgumentNode; $namedArgument->startPosition = $thisNode->startPosition; $namedArgument->endPosition = $valueNode->endPosition; $namedArgument->content = $thisNode->content.$valueNode->content; @@ -1641,7 +1641,7 @@ private function groupNodesByType($nodes, $type) $right = $nodes[$i + 1]; - $logicGroup = new LogicGroup(); + $logicGroup = new LogicGroup; $logicGroup->nodes = array_merge($left, []); $logicGroup->nodes[] = $node; $logicGroup->nodes[] = $right; @@ -1756,7 +1756,7 @@ private function resolveValueRight($nodes, $index) } if ($negationCount % 2 != 0) { - $logicGroup = new LogicGroup(); + $logicGroup = new LogicGroup; $logicGroup->nodes = [$lastNegation, $value]; return [$logicGroup, $negationCount]; @@ -1771,14 +1771,14 @@ private function correctTypes($nodes) foreach ($nodes as $node) { if ($node instanceof ModifierValueSeparator) { - $branchSeparator = new InlineBranchSeparator(); + $branchSeparator = new InlineBranchSeparator; $branchSeparator->startPosition = $node->startPosition; $branchSeparator->endPosition = $node->endPosition; $newNodes[] = $branchSeparator; continue; } elseif ($node instanceof ModifierValueNode) { - $varNode = new VariableNode(); + $varNode = new VariableNode; $varNode->name = $node->value; $varNode->startPosition = $node->startPosition; $varNode->endPosition = $node->endPosition; @@ -2066,12 +2066,12 @@ private function createLogicGroupsAroundMethodCalls($nodes) $i = $skipTo; } - $wrapper = new LogicGroup(); + $wrapper = new LogicGroup; $wrapper->startPosition = $targetNodes[0]->startPosition; $wrapper->endPosition = $targetNodes[count($targetNodes) - 1]->endPosition; $wrapper->nodes = $targetNodes; - $semanticWrapper = new SemanticGroup(); + $semanticWrapper = new SemanticGroup; $semanticWrapper->nodes[] = $wrapper; $newNodes[] = $semanticWrapper; @@ -2109,7 +2109,7 @@ private function associateModifiers($tokens) $applyModifiersToNode = $newNodes[$newNodeCount - 1]; if ($applyModifiersToNode->modifierChain == null) { - $applyModifiersToNode->modifierChain = new ModifierChainNode(); + $applyModifiersToNode->modifierChain = new ModifierChainNode; } if ($i + 1 >= $tokenCount) { @@ -2250,7 +2250,7 @@ private function isValidModifierValue($node) private function wrapNumberInVariable(NumberNode $node) { - $variableNode = new VariableNode(); + $variableNode = new VariableNode; $variableNode->startPosition = $node->startPosition; $variableNode->endPosition = $node->endPosition; $variableNode->name = strval($node->value); @@ -2265,7 +2265,7 @@ private function wrapNumberInVariable(NumberNode $node) private function wrapConstantInVariable(AbstractNode $node) { - $variableNode = new VariableNode(); + $variableNode = new VariableNode; $variableNode->startPosition = $node->startPosition; $variableNode->endPosition = $node->endPosition; $variableNode->name = strval($node->content); @@ -2287,7 +2287,7 @@ private function wrapConstantInVariable(AbstractNode $node) */ private function wrapArithmeticModifier(AbstractNode $operator, $modifierName) { - $node = new ModifierNameNode(); + $node = new ModifierNameNode; $node->startPosition = $operator->startPosition; $node->endPosition = $operator->endPosition; $node->originalAbstractNode = $operator; @@ -2314,7 +2314,7 @@ private function createModifier($tokens) $unwrapped = $this->unpack($tokens[0]->nodes); $tArgGroup = $this->makeArgGroup($unwrapped); - $modifierNode = new ModifierNode(); + $modifierNode = new ModifierNode; $modifierNode->nameNode = $modifierName; $modifierNode->methodStyleArguments = $tArgGroup; @@ -2342,7 +2342,7 @@ private function createModifier($tokens) // Unwind the combined variable and covert them to modifier parameters. foreach ($next->variableReference->pathParts as $combinedPart) { if ($combinedPart instanceof PathNode) { - $modifierValue = new ModifierValueNode(); + $modifierValue = new ModifierValueNode; $modifierValue->startPosition = $combinedPart->startPosition; $modifierValue->endPosition = $combinedPart->endPosition; $modifierValue->value = $combinedPart->name; @@ -2352,7 +2352,7 @@ private function createModifier($tokens) } } } else { - $modifierValue = new ModifierValueNode(); + $modifierValue = new ModifierValueNode; $modifierValue->startPosition = $next->startPosition; $modifierValue->endPosition = $next->endPosition; $modifierValue->value = $next->name; @@ -2377,7 +2377,7 @@ private function createModifier($tokens) } } - $modifierNode = new ModifierNode(); + $modifierNode = new ModifierNode; $modifierNode->nameNode = $modifierName; $modifierNode->valueNodes = $values; @@ -2465,7 +2465,7 @@ private function insertAutomaticStatementSeparators($tokens) if ($peek instanceof StatementSeparatorNode == false) { $adjustedTokens[] = $thisToken; $adjustedTokens[] = $tokens[$i + 1]; - $adjustedTokens[] = new StatementSeparatorNode(); + $adjustedTokens[] = new StatementSeparatorNode; $i += 1; continue; @@ -2480,7 +2480,7 @@ private function insertAutomaticStatementSeparators($tokens) } else { $adjustedTokens[] = $thisToken; $adjustedTokens[] = $tokens[$i + 1]; - $adjustedTokens[] = new StatementSeparatorNode(); + $adjustedTokens[] = new StatementSeparatorNode; break; } } else { @@ -2500,7 +2500,7 @@ private function createSemanticGroups($tokens) for ($i = 0; $i < $tokenCount; $i++) { if ($tokens[$i] instanceof StatementSeparatorNode) { - $semanticGroup = new SemanticGroup(); + $semanticGroup = new SemanticGroup; $semanticGroup->nodes = $groupNodes; $groups[] = $semanticGroup; $groupNodes = []; @@ -2510,7 +2510,7 @@ private function createSemanticGroups($tokens) $groupNodes[] = $tokens[$i]; if ($i + 1 >= $tokenCount) { - $semanticGroup = new SemanticGroup(); + $semanticGroup = new SemanticGroup; $semanticGroup->nodes = $groupNodes; $groups[] = $semanticGroup; break; @@ -2542,7 +2542,7 @@ private function createNullCoalescenceGroups($tokens) $right = $tokens[$i + 1]; - $nullCoalescenceGroup = new NullCoalescenceGroup(); + $nullCoalescenceGroup = new NullCoalescenceGroup; $nullCoalescenceGroup->left = $left; $nullCoalescenceGroup->right = $right; $newTokens[] = $nullCoalescenceGroup; @@ -2574,7 +2574,7 @@ private function collectUntil(&$tokens) $collectedTokens = array_reverse($collectedTokens); if (count($collectedTokens) >= 3) { - $parser = new LanguageParser(); + $parser = new LanguageParser; $parser->setIsRoot(false); return $this->unpack($parser->parse($collectedTokens)); @@ -2655,7 +2655,7 @@ private function createTernaryGroups($tokens) $falseBranch = $tokens[$falseBranchStart]; - $ternaryStructure = new TernaryCondition(); + $ternaryStructure = new TernaryCondition; $ternaryStructure->head = $condition; $ternaryStructure->truthBranch = $truthBranch; $ternaryStructure->falseBranch = $falseBranch; @@ -2727,7 +2727,7 @@ private function createLogicalGroups($tokens) } } - $factorialOperator = new FactorialOperator(); + $factorialOperator = new FactorialOperator; $factorialOperator->startPosition = $token->startPosition; $factorialOperator->endPosition = $token->endPosition; $factorialOperator->content = str_repeat('!', $negationCount); @@ -2775,7 +2775,7 @@ private function createLogicalGroups($tokens) /** @var LogicGroup $subGroup */ $subGroup = $groupResults[0]; // Let's now wrap this in it's own group to negate the entire thing. - $wrapperGroup = new LogicGroup(); + $wrapperGroup = new LogicGroup; $wrapperGroup->start = $token; $wrapperGroup->end = $subGroup; $wrapperGroup->nodes = [$token, $subGroup]; @@ -2838,7 +2838,7 @@ private function createLogicalGroups($tokens) /** @var AbstractNode $prev */ $prev = array_pop($groupedTokens); - $wrapperGroup = new LogicGroup(); + $wrapperGroup = new LogicGroup; $wrapperGroup->startPosition = $prev->startPosition; $wrapperGroup->endPosition = $token->endPosition; $wrapperGroup->originalAbstractNode = $token; @@ -2903,13 +2903,13 @@ private function findLogicalGroupEnd($root, $nodes) ); } - $parser = new LanguageParser(); + $parser = new LanguageParser; $parser->setIsRoot(false); - $logicalGroup = new LogicGroup(); + $logicalGroup = new LogicGroup; if (count($subNodes) >= 2 && $subNodes[1] instanceof ScopeAssignmentOperator) { - $logicalGroup = new ScopedLogicGroup(); + $logicalGroup = new ScopedLogicGroup; if ($i + 2 < $nodeCount && $nodes[$i + 1] instanceof VariableNode && $nodes[$i + 2] instanceof StringValueNode) { /** @var VariableNode $candidateVarNode */ @@ -2919,7 +2919,7 @@ private function findLogicalGroupEnd($root, $nodes) /** @var StringValueNode $aliasNode */ $aliasNode = $nodes[$i + 2]; - $logicalGroup = new AliasedScopeLogicGroup(); + $logicalGroup = new AliasedScopeLogicGroup; $logicalGroup->alias = $aliasNode; $skipCount += 2; } diff --git a/src/View/Antlers/Language/Parser/PathParser.php b/src/View/Antlers/Language/Parser/PathParser.php index b797049bc8..234637ab13 100644 --- a/src/View/Antlers/Language/Parser/PathParser.php +++ b/src/View/Antlers/Language/Parser/PathParser.php @@ -213,7 +213,7 @@ public function parse($content) if ($this->isParsingString == false && $this->cur == self::LeftBracket) { if (! empty($currentChars)) { - $pathNode = new PathNode(); + $pathNode = new PathNode; $pathNode->name = implode($currentChars); $pathNode->delimiter = $activeDelimiter; $parts[] = $pathNode; @@ -230,7 +230,7 @@ public function parse($content) $results = $this->locateEndOfAccessor(); $this->currentIndex = $results[0]; - $parser = new PathParser(); + $parser = new PathParser; $parts[] = $parser->parse($results[1]); @@ -246,7 +246,7 @@ public function parse($content) $addCur = true; } - $accessorNode = new AccessorNode(); + $accessorNode = new AccessorNode; $accessorNode->name = implode($currentChars); $parts[] = $accessorNode; @@ -304,7 +304,7 @@ public function parse($content) } } - $pathNode = new PathNode(); + $pathNode = new PathNode; $pathNode->delimiter = $activeDelimiter; $pathNode->name = implode($currentChars); @@ -332,7 +332,7 @@ public function parse($content) $parts[$partLen - 1]->isFinal = true; } - $variableReference = new VariableReference(); + $variableReference = new VariableReference; $variableReference->isStrictTagReference = $isStrictTagReference; $variableReference->isStrictVariableReference = $isStrictVariableReference; $variableReference->isExplicitVariableReference = $isExplicitVariableReference; diff --git a/src/View/Antlers/Language/Runtime/ConditionProcessor.php b/src/View/Antlers/Language/Runtime/ConditionProcessor.php index bc1c30c33e..a36ee5ff89 100644 --- a/src/View/Antlers/Language/Runtime/ConditionProcessor.php +++ b/src/View/Antlers/Language/Runtime/ConditionProcessor.php @@ -59,8 +59,8 @@ public function process(ConditionNode $node, $data) // they may want to change their behavior. $this->processor->setIsConditionProcessor(true); - $parser = new LanguageParser(); - $environment = new Environment(); + $parser = new LanguageParser; + $environment = new Environment; $environment->setProcessor($this->processor); $dataToUse = $data; $interpolationReplacements = []; diff --git a/src/View/Antlers/Language/Runtime/Debugging/GlobalDebugManager.php b/src/View/Antlers/Language/Runtime/Debugging/GlobalDebugManager.php index 33118a0895..afbba69356 100644 --- a/src/View/Antlers/Language/Runtime/Debugging/GlobalDebugManager.php +++ b/src/View/Antlers/Language/Runtime/Debugging/GlobalDebugManager.php @@ -39,7 +39,7 @@ class GlobalDebugManager public static function getTimingsTracer() { if (self::$timingsTracer == null) { - self::$timingsTracer = new TimingsTracer(); + self::$timingsTracer = new TimingsTracer; } return self::$timingsTracer; @@ -133,7 +133,7 @@ public static function getStackFrames() } } - $stackFrame = new StackFrame(); + $stackFrame = new StackFrame; $stackFrame->line = $stackLine; $stackFrame->column = $stackColumn; $stackFrame->pathSource = $stackSource; @@ -158,7 +158,7 @@ private static function writeCurrentLock($line, NodeProcessor $processor) $activeData = $processor->getActiveData(); $dump = [ - 'data' => (new ScopeDumper())->dump($activeData), + 'data' => (new ScopeDumper)->dump($activeData), 'frames' => self::getStackFrames(), ]; @@ -286,7 +286,7 @@ private static function loadRuntimeBreakpoints() foreach ($existingBreakpoints as $bpPath) { $contents = \json_decode(file_get_contents($bpPath), true); - $runtimeBreakpoint = new Breakpoint(); + $runtimeBreakpoint = new Breakpoint; $runtimeBreakpoint->path = $contents['path']; $runtimeBreakpoint->line = $contents['line']; $runtimeBreakpoint->debugId = $contents['encode']; diff --git a/src/View/Antlers/Language/Runtime/Debugging/ScopeDumper.php b/src/View/Antlers/Language/Runtime/Debugging/ScopeDumper.php index 9b4c6a960c..d2edc692e6 100644 --- a/src/View/Antlers/Language/Runtime/Debugging/ScopeDumper.php +++ b/src/View/Antlers/Language/Runtime/Debugging/ScopeDumper.php @@ -132,7 +132,7 @@ private function createVariables($data) $vars = []; foreach ($data as $k => $v) { - $variable = new DumpVariable(); + $variable = new DumpVariable; $variable->name = strval($k); if (is_string($v)) { diff --git a/src/View/Antlers/Language/Runtime/Debugging/Tracers/TimingsTracer.php b/src/View/Antlers/Language/Runtime/Debugging/Tracers/TimingsTracer.php index ea0de9e00c..87d861eb84 100644 --- a/src/View/Antlers/Language/Runtime/Debugging/Tracers/TimingsTracer.php +++ b/src/View/Antlers/Language/Runtime/Debugging/Tracers/TimingsTracer.php @@ -62,9 +62,7 @@ public function onExit(AbstractNode $node, $runtimeContent) } } - public function onRenderComplete() - { - } + public function onRenderComplete() {} public function getTimings() { diff --git a/src/View/Antlers/Language/Runtime/NodeProcessor.php b/src/View/Antlers/Language/Runtime/NodeProcessor.php index 733e60dfee..f78b3c3406 100644 --- a/src/View/Antlers/Language/Runtime/NodeProcessor.php +++ b/src/View/Antlers/Language/Runtime/NodeProcessor.php @@ -225,10 +225,10 @@ public function __construct(Loader $loader, EnvironmentDetails $envDetails) { $this->loader = $loader; $this->envDetails = $envDetails; - $this->pathDataManager = new PathDataManager(); + $this->pathDataManager = new PathDataManager; $this->pathDataManager->setNodeProcessor($this); - $this->languageParser = new LanguageParser(); - $this->conditionProcessor = new ConditionProcessor(); + $this->languageParser = new LanguageParser; + $this->conditionProcessor = new ConditionProcessor; $this->conditionProcessor->setProcessor($this); if (ini_get('short_open_tag')) { @@ -1036,7 +1036,7 @@ public function evaluateDeferredLogicGroup(LogicGroup $group, array $additionalC $scope = $additionalContext + $scope; } - $environment = new Environment(); + $environment = new Environment; $environment->setProcessor($this); $environment->cascade($this->cascade)->setData($scope); @@ -1045,7 +1045,7 @@ public function evaluateDeferredLogicGroup(LogicGroup $group, array $additionalC public function evaluateDeferredVariable(AbstractNode $deferredNode) { - $environment = new Environment(); + $environment = new Environment; $environment->setProcessor($this); $environment->cascade($this->cascade)->setData($this->getActiveData()); @@ -1865,7 +1865,7 @@ public function reduce($processNodes) } } - $environment = new Environment(); + $environment = new Environment; $environment->cascade($this->cascade)->setData($environmentData); $environment->setProcessor($this); @@ -2014,7 +2014,7 @@ public function reduce($processNodes) } } } elseif (count($node->runtimeNodes) == 0 && $node->isTagNode) { - $dataRetriever = new PathDataManager(); + $dataRetriever = new PathDataManager; if (! empty(GlobalRuntimeState::$prefixState)) { $dataRetriever->setHandlePrefixes(array_reverse(GlobalRuntimeState::$prefixState)); } @@ -2055,7 +2055,7 @@ public function reduce($processNodes) if ($runtimeResolveLoopVar == false) { if ($node->pathReference != null) { - $dataRetriever = new PathDataManager(); + $dataRetriever = new PathDataManager; if (! empty(GlobalRuntimeState::$prefixState)) { $dataRetriever->setHandlePrefixes(array_reverse(GlobalRuntimeState::$prefixState)); } diff --git a/src/View/Antlers/Language/Runtime/PathDataManager.php b/src/View/Antlers/Language/Runtime/PathDataManager.php index be8b289b5e..cbf0a1791b 100644 --- a/src/View/Antlers/Language/Runtime/PathDataManager.php +++ b/src/View/Antlers/Language/Runtime/PathDataManager.php @@ -519,7 +519,7 @@ public function getData(VariableReference $path, $data, $isForArrayIndex = false $pathCopy->isVariableVariable = false; $dynamicPath = (string) $this->getData($pathCopy, $data); - $tempPathParser = new PathParser(); + $tempPathParser = new PathParser; $path = $tempPathParser->parse($dynamicPath); if (! $this->guardRuntimeAccess($path->normalizedReference)) { @@ -721,7 +721,7 @@ public function getData(VariableReference $path, $data, $isForArrayIndex = false $referencePath = $processor->cloneProcessor()->setData($data) ->setIsInterpolationProcessor(true)->reduce($this->interpolations[$pathItem->originalContent]); } else { - $retriever = new PathDataManager(); + $retriever = new PathDataManager; $retriever->setInterpolations($this->interpolations); $retriever->setEnvironment($this->environment); $retriever->setIsPaired(false); diff --git a/src/View/Antlers/Language/Runtime/RuntimeParser.php b/src/View/Antlers/Language/Runtime/RuntimeParser.php index 37156c88ab..875828427b 100644 --- a/src/View/Antlers/Language/Runtime/RuntimeParser.php +++ b/src/View/Antlers/Language/Runtime/RuntimeParser.php @@ -794,9 +794,9 @@ public function injectNoparse($text) */ private function wrapText($text) { - $node = new AntlersNode(); + $node = new AntlersNode; - $mockPosition = new Position(); + $mockPosition = new Position; $mockPosition->offset = 0; $mockPosition->line = 0; $mockPosition->char = 0; @@ -872,11 +872,11 @@ public function getVariable($key, $context, $default = null) return $processor->evaluateDeferredVariable($variableNode); } - $pathParser = new PathParser(); + $pathParser = new PathParser; $path = $pathParser->parse($key); - $pathDataManager = new PathDataManager(); + $pathDataManager = new PathDataManager; $pathDataManager->setIsPaired(false); $pathDataManager->cascade($this->cascade); diff --git a/src/View/Antlers/Language/Runtime/Sandbox/Environment.php b/src/View/Antlers/Language/Runtime/Sandbox/Environment.php index f39a8ed31f..b3b700e630 100644 --- a/src/View/Antlers/Language/Runtime/Sandbox/Environment.php +++ b/src/View/Antlers/Language/Runtime/Sandbox/Environment.php @@ -122,11 +122,11 @@ class Environment public function __construct() { - $this->pathParser = new PathParser(); - $this->dataRetriever = new PathDataManager(); + $this->pathParser = new PathParser; + $this->dataRetriever = new PathDataManager; $this->dataRetriever->setEnvironment($this); $this->dataRetriever->setIsPaired(false); - $this->operatorManager = new LanguageOperatorManager(); + $this->operatorManager = new LanguageOperatorManager; $this->operatorManager->setEnvironment($this); } @@ -1191,7 +1191,7 @@ private function evaluateNullCoalescence(NullCoalescenceGroup $group) */ private function evaluateTernaryGroup(TernaryCondition $condition) { - $env = new Environment(); + $env = new Environment; $env->setProcessor($this->nodeProcessor); $env->setData($this->data); $headValue = $env->evaluateBool($condition->head); @@ -1410,7 +1410,7 @@ private function getIsAscendingDirection($node) return $node->value >= 1; } - $env = new Environment(); + $env = new Environment; $env->setProcessor($this->nodeProcessor); $env->setData($this->data); $envResult = $env->evaluate([$node]); @@ -1468,7 +1468,7 @@ public function evaluateDirectionGroup(DirectionGroup $group) */ public function evaluateArgumentGroup(ArgumentGroup $argumentGroup) { - $env = new Environment(); + $env = new Environment; $env->setProcessor($this->nodeProcessor); $env->setData($this->data); diff --git a/src/View/Antlers/Language/Runtime/Sandbox/LanguageOperatorManager.php b/src/View/Antlers/Language/Runtime/Sandbox/LanguageOperatorManager.php index 4c0867e1d0..62a5b25ef8 100644 --- a/src/View/Antlers/Language/Runtime/Sandbox/LanguageOperatorManager.php +++ b/src/View/Antlers/Language/Runtime/Sandbox/LanguageOperatorManager.php @@ -47,7 +47,7 @@ class LanguageOperatorManager public function __construct() { - $this->dataManager = new PathDataManager(); + $this->dataManager = new PathDataManager; } public function setNodeProcessor(NodeProcessor $processor) @@ -160,7 +160,7 @@ protected function unpackQueryLogicGroup(LogicGroup $group) */ private function makeEnvironment() { - $env = new Environment(); + $env = new Environment; $env->setProcessor($this->hostProcessor); return $env; @@ -170,7 +170,7 @@ protected function getVarNode($string) { if (array_key_exists($string, self::$parsedVarCache) == false) { if (self::$varParser == null) { - self::$varParser = new PathParser(); + self::$varParser = new PathParser; } try { diff --git a/src/View/Antlers/Parser.php b/src/View/Antlers/Parser.php index 28161e257f..c6b1814b83 100644 --- a/src/View/Antlers/Parser.php +++ b/src/View/Antlers/Parser.php @@ -1304,7 +1304,7 @@ protected function replaceDynamicArrayKeys($key, $context) if (! (is_string($value) || is_numeric($value))) { // If the variable does not exist in the context or the value is not a valid key // the replacement should not return a value to prevent unexpected behaviour. - throw new ArrayKeyNotFoundException(); + throw new ArrayKeyNotFoundException; } return '.'.$value; diff --git a/src/View/Debugbar/AntlersProfiler/PerformanceTracer.php b/src/View/Debugbar/AntlersProfiler/PerformanceTracer.php index 39a5e3035d..e0b6e6ca0d 100644 --- a/src/View/Debugbar/AntlersProfiler/PerformanceTracer.php +++ b/src/View/Debugbar/AntlersProfiler/PerformanceTracer.php @@ -178,7 +178,7 @@ private function sampleEnvironmentData() { $currentMemory = memory_get_usage() - $this->memorySampleBaseline; - $sample = new RuntimeSample(); + $sample = new RuntimeSample; $sample->time = (microtime(true) * 1000) - $this->firstSampleTime; $sample->memory = $currentMemory; $sample->antlersNodesProcessed = $this->antlersNodesObserved; @@ -395,7 +395,5 @@ public function onExit(AbstractNode $node, $runtimeContent) } } - public function onRenderComplete() - { - } + public function onRenderComplete() {} } diff --git a/src/View/State/CachesOutput.php b/src/View/State/CachesOutput.php index 3e3db7748a..01c7fe5d5c 100644 --- a/src/View/State/CachesOutput.php +++ b/src/View/State/CachesOutput.php @@ -2,6 +2,4 @@ namespace Statamic\View\State; -interface CachesOutput -{ -} +interface CachesOutput {} diff --git a/tests/Antlers/Parser/DocumentTransformerTest.php b/tests/Antlers/Parser/DocumentTransformerTest.php index 921460339f..6295b19cac 100644 --- a/tests/Antlers/Parser/DocumentTransformerTest.php +++ b/tests/Antlers/Parser/DocumentTransformerTest.php @@ -811,7 +811,7 @@ public function test_transformer_does_not_skip_things() {{ /collection:articles }} EOT; - $result = (new DocumentTransformer())->load($template)->getTemplate(); + $result = (new DocumentTransformer)->load($template)->getTemplate(); $this->assertSame($template, $result); } @@ -822,7 +822,7 @@ public function test_transformer_can_correct_html_encoded_content()

{{ if 1 > 3 }}Yes.{{ else }}No.{{ /if }}
{{ if 1 < 3 && true == true }}Yes.{{ else }}No.{{ /if }}
{{ if 3 > 1 }}3 is bigger{{ /if }}
{{ now format="Y" }}
Just some content

EOT; - $transformer = new DocumentTransformer(); + $transformer = new DocumentTransformer; $reversed = $transformer->correct($template); $this->assertSame('

{{ if 1 > 3 }}Yes.{{ else }}No.{{ /if }}
{{ if 1 < 3 && true == true }}Yes.{{ else }}No.{{ /if }}
{{ if 3 > 1 }}3 is bigger{{ /if }}
{{ now format="Y" }}
Just some content

', $reversed); diff --git a/tests/Antlers/ParserTestCase.php b/tests/Antlers/ParserTestCase.php index 24c037997b..4eeedc50ad 100644 --- a/tests/Antlers/ParserTestCase.php +++ b/tests/Antlers/ParserTestCase.php @@ -49,7 +49,7 @@ protected function setUp(): void $this->setupTestBlueprintAndFields(); - NodeTypeAnalyzer::$environmentDetails = new EnvironmentDetails(); + NodeTypeAnalyzer::$environmentDetails = new EnvironmentDetails; NodeTypeAnalyzer::$environmentDetails->setModifierNames(['upper', 'lower']); } @@ -91,7 +91,7 @@ protected function setupTestBlueprintAndFields() return $item['field']; })->all(); - $blueprintsRepository = new BlueprintRepository(); + $blueprintsRepository = new BlueprintRepository; self::$testBlueprint = $blueprintsRepository->makeFromFields($blueprintFields); } @@ -102,14 +102,14 @@ protected function setupTestBlueprintAndFields() protected function parsePath($path) { - $pathParser = new PathParser(); + $pathParser = new PathParser; return $pathParser->parse($path); } protected function parseNodes($text) { - $documentParser = new DocumentParser(); + $documentParser = new DocumentParser; $documentParser->parse($text); return $documentParser->getNodes(); @@ -154,7 +154,7 @@ protected function parseTemplate($template) { $contents = $this->getTemplate($template); - $documentParser = new DocumentParser(); + $documentParser = new DocumentParser; $documentParser->parse($contents); return $documentParser->getRenderNodes(); @@ -164,9 +164,9 @@ protected function parser($data = [], $withCoreTagsAndModifiers = false) { GlobalRuntimeState::resetGlobalState(); - $documentParser = new DocumentParser(); - $loader = new Loader(); - $envDetails = new EnvironmentDetails(); + $documentParser = new DocumentParser; + $loader = new Loader; + $envDetails = new EnvironmentDetails; if ($withCoreTagsAndModifiers) { $envDetails->setTagNames(app()->make('statamic.tags')->keys()->all()); @@ -178,16 +178,16 @@ protected function parser($data = [], $withCoreTagsAndModifiers = false) $processor = new NodeProcessor($loader, $envDetails); $processor->setData($data); - return new RuntimeParser($documentParser, $processor, new AntlersLexer(), new LanguageParser()); + return new RuntimeParser($documentParser, $processor, new AntlersLexer, new LanguageParser); } protected function renderStringWithConfiguration($text, RuntimeConfiguration $config, $data = [], $withCoreTagsAndModifiers = false) { GlobalRuntimeState::resetGlobalState(); - $documentParser = new DocumentParser(); - $loader = new Loader(); - $envDetails = new EnvironmentDetails(); + $documentParser = new DocumentParser; + $loader = new Loader; + $envDetails = new EnvironmentDetails; if ($withCoreTagsAndModifiers) { $envDetails->setTagNames(app()->make('statamic.tags')->keys()->all()); @@ -200,7 +200,7 @@ protected function renderStringWithConfiguration($text, RuntimeConfiguration $co $processor->setRuntimeConfiguration($config); $processor->setData($data); - $runtimeParser = new RuntimeParser($documentParser, $processor, new AntlersLexer(), new LanguageParser()); + $runtimeParser = new RuntimeParser($documentParser, $processor, new AntlersLexer, new LanguageParser); if ($withCoreTagsAndModifiers) { $runtimeParser->cascade(app(Cascade::class)); @@ -214,9 +214,9 @@ protected function renderString($text, $data = [], $withCoreTagsAndModifiers = f ModifierManager::$statamicModifiers = null; GlobalRuntimeState::resetGlobalState(); - $documentParser = new DocumentParser(); - $loader = new Loader(); - $envDetails = new EnvironmentDetails(); + $documentParser = new DocumentParser; + $loader = new Loader; + $envDetails = new EnvironmentDetails; if ($withCoreTagsAndModifiers) { $envDetails->setTagNames(app()->make('statamic.tags')->keys()->all()); @@ -228,7 +228,7 @@ protected function renderString($text, $data = [], $withCoreTagsAndModifiers = f $processor = new NodeProcessor($loader, $envDetails); $processor->setData($data); - $runtimeParser = new RuntimeParser($documentParser, $processor, new AntlersLexer(), new LanguageParser()); + $runtimeParser = new RuntimeParser($documentParser, $processor, new AntlersLexer, new LanguageParser); $processor->setAntlersParserInstance($runtimeParser); if ($withCoreTagsAndModifiers) { @@ -240,11 +240,11 @@ protected function renderString($text, $data = [], $withCoreTagsAndModifiers = f protected function getParsedRuntimeNodes($text) { - $documentParser = new DocumentParser(); + $documentParser = new DocumentParser; $documentParser->parse($text); $node = $documentParser->getNodes()[0]; - $antlersParser = new LanguageParser(); + $antlersParser = new LanguageParser; return $antlersParser->parse($node->runtimeNodes); } @@ -256,13 +256,13 @@ protected function getBoolResult($text, $data) /** @var AntlersNode $antlersNode */ $antlersNode = $this->parseNodes($nodeText)[0]; - $lexer = new AntlersLexer(); + $lexer = new AntlersLexer; $tokens = $lexer->tokenize($antlersNode, $text); - $langParser = new LanguageParser(); + $langParser = new LanguageParser; $nodes = $langParser->parse($tokens); - $sandbox = new Environment(); + $sandbox = new Environment; $sandbox->setData($data); return $sandbox->evaluateBool($nodes); @@ -277,18 +277,18 @@ protected function evaluateRaw($text, $data = []) /** @var AntlersNode $antlersNode */ $antlersNode = $this->parseNodes($nodeText)[0]; - $lexer = new AntlersLexer(); + $lexer = new AntlersLexer; $tokens = $lexer->tokenize($antlersNode, $text); - $langParser = new LanguageParser(); + $langParser = new LanguageParser; $nodes = $langParser->parse($tokens); - $loader = new Loader(); - $envDetails = new EnvironmentDetails(); + $loader = new Loader; + $envDetails = new EnvironmentDetails; $processor = new NodeProcessor($loader, $envDetails); $processor->setData($data); - $sandbox = new Environment(); + $sandbox = new Environment; $sandbox->setProcessor($processor); $sandbox->setData($data); @@ -302,18 +302,18 @@ protected function evaluateBoth($text, $data = []) /** @var AntlersNode $antlersNode */ $antlersNode = $this->parseNodes($nodeText)[0]; - $lexer = new AntlersLexer(); + $lexer = new AntlersLexer; $tokens = $lexer->tokenize($antlersNode, $text); - $langParser = new LanguageParser(); + $langParser = new LanguageParser; $nodes = $langParser->parse($tokens); - $loader = new Loader(); - $envDetails = new EnvironmentDetails(); + $loader = new Loader; + $envDetails = new EnvironmentDetails; $processor = new NodeProcessor($loader, $envDetails); $processor->setData($data); - $sandbox = new Environment(); + $sandbox = new Environment; $sandbox->setProcessor($processor); $sandbox->setData($data); @@ -327,16 +327,16 @@ protected function evaluate($text, $data = []) /** @var AntlersNode $antlersNode */ $antlersNode = $this->parseNodes($nodeText)[0]; - $lexer = new AntlersLexer(); + $lexer = new AntlersLexer; $tokens = $lexer->tokenize($antlersNode, $text); - $langParser = new LanguageParser(); + $langParser = new LanguageParser; $nodes = $langParser->parse($tokens); - $loader = new Loader(); - $envDetails = new EnvironmentDetails(); + $loader = new Loader; + $envDetails = new EnvironmentDetails; $processor = new NodeProcessor($loader, $envDetails); - $sandbox = new Environment(); + $sandbox = new Environment; $sandbox->setData($data); $sandbox->setProcessor($processor); diff --git a/tests/Antlers/Runtime/ConditionLogicTest.php b/tests/Antlers/Runtime/ConditionLogicTest.php index 2b6bd983fa..a90dcfc4dc 100644 --- a/tests/Antlers/Runtime/ConditionLogicTest.php +++ b/tests/Antlers/Runtime/ConditionLogicTest.php @@ -360,7 +360,7 @@ public function test_modifier_chains_break_on_equality_comparison_operator() public function test_empty_terms_collection_is_falsey() { - $terms = new TermCollection(); + $terms = new TermCollection; $value = new Value($terms); $template = '{{ if topics }}yes{{ else }}no{{ /if }}'; @@ -371,7 +371,7 @@ public function test_empty_terms_collection_is_falsey() public function test_values_are_resolved_in_conditions() { - $fieldType = new Select(); + $fieldType = new Select; // Values are different from handle here to ensure that it returns the value // and not the name of the variable, and to ensure it's not the handle. @@ -780,7 +780,7 @@ public function test_uppercase_logical_keywords_in_conditions() public function test_arrayable_strings_inside_conditions_used_with_modifiers() { - $code = new Code(); + $code = new Code; $field = new Field('code_field', [ 'type' => 'code', 'antlers' => false, diff --git a/tests/Antlers/Runtime/ConditionalLogicValueTest.php b/tests/Antlers/Runtime/ConditionalLogicValueTest.php index 8f5fdcdc67..f7f5b41746 100644 --- a/tests/Antlers/Runtime/ConditionalLogicValueTest.php +++ b/tests/Antlers/Runtime/ConditionalLogicValueTest.php @@ -14,10 +14,10 @@ class ConditionalLogicValueTest extends ParserTestCase { public function test_conditionals_handle_values_transparently() { - $integerFieldType = new Integer(); - $floatFieldType = new Floatval(); - $checkboxFieldType = new Checkboxes(); - $buttonFieldType = new ButtonGroup(); + $integerFieldType = new Integer; + $floatFieldType = new Floatval; + $checkboxFieldType = new Checkboxes; + $buttonFieldType = new ButtonGroup; $buttonFieldType->setField(new Field('button_value', [ 'options' => [ 'one' => 'One', diff --git a/tests/Antlers/Runtime/CoreModifiersTest.php b/tests/Antlers/Runtime/CoreModifiersTest.php index 4b7dc8040b..09079a667e 100644 --- a/tests/Antlers/Runtime/CoreModifiersTest.php +++ b/tests/Antlers/Runtime/CoreModifiersTest.php @@ -496,11 +496,11 @@ public function test_explode_on_tag_pairs() public function test_runtime_maintains_arrays_of_objects() { - $entryOne = new SimpleEntryObject(); + $entryOne = new SimpleEntryObject; $entryOne->date = Carbon::parse('October 1st, 2012'); $entryOne->title = 'Title One'; - $entryTwo = new SimpleEntryObject(); + $entryTwo = new SimpleEntryObject; $entryTwo->date = Carbon::parse('November 1st, 2012'); $entryTwo->title = 'The Second Title'; diff --git a/tests/Antlers/Runtime/DataRetrieverTest.php b/tests/Antlers/Runtime/DataRetrieverTest.php index 851048b52d..bbb87d4395 100644 --- a/tests/Antlers/Runtime/DataRetrieverTest.php +++ b/tests/Antlers/Runtime/DataRetrieverTest.php @@ -9,7 +9,7 @@ class DataRetrieverTest extends ParserTestCase { private function getPathValue($path, $data) { - $dataRetriever = new PathDataManager(); + $dataRetriever = new PathDataManager; return $dataRetriever->getData($this->parsePath($path), $data); } diff --git a/tests/Antlers/Runtime/Fieldtypes/AssetTemplateTest.php b/tests/Antlers/Runtime/Fieldtypes/AssetTemplateTest.php index fca55a3409..7a64d93c01 100644 --- a/tests/Antlers/Runtime/Fieldtypes/AssetTemplateTest.php +++ b/tests/Antlers/Runtime/Fieldtypes/AssetTemplateTest.php @@ -36,7 +36,7 @@ protected function setUp(): void public function test_asset_returns_implicit_string_value() { - $asset = new Asset(); + $asset = new Asset; $asset->container($this->container); $asset->path('path/to/asset.jpg'); @@ -59,7 +59,7 @@ public function test_passing_asset_in_parameter_actually_passes_asset() { VarTest::register(); - $asset = new Asset(); + $asset = new Asset; $asset->container($this->container); $asset->path('path/to/asset.jpg'); @@ -76,7 +76,7 @@ public function test_passing_asset_in_parameter_actually_passes_asset() public function test_asset_assignment() { - $asset = new Asset(); + $asset = new Asset; $asset->container($this->container); $asset->path('path/to/asset.jpg'); @@ -92,7 +92,7 @@ public function test_asset_assignment() public function test_parameter_values_are_not_lost_when_passed_into_tags() { - $asset = new Asset(); + $asset = new Asset; $asset->container($this->container); $asset->path('path/to/asset.jpg'); diff --git a/tests/Antlers/Runtime/Fieldtypes/BardFieldtypeTest.php b/tests/Antlers/Runtime/Fieldtypes/BardFieldtypeTest.php index 8bda82fe40..aeb710453d 100644 --- a/tests/Antlers/Runtime/Fieldtypes/BardFieldtypeTest.php +++ b/tests/Antlers/Runtime/Fieldtypes/BardFieldtypeTest.php @@ -22,7 +22,7 @@ public function test_raw_parameter_style_modifier_can_be_used_on_values() public function test_antlers_true_bard_fields_correct_for_html_encoded_values() { - $bard = new Bard(); + $bard = new Bard; $field = new Field('test', [ 'type' => 'bard', 'antlers' => true, diff --git a/tests/Antlers/Runtime/Fieldtypes/CodeFieldtypeTest.php b/tests/Antlers/Runtime/Fieldtypes/CodeFieldtypeTest.php index 84b9f80330..6f10297116 100644 --- a/tests/Antlers/Runtime/Fieldtypes/CodeFieldtypeTest.php +++ b/tests/Antlers/Runtime/Fieldtypes/CodeFieldtypeTest.php @@ -16,7 +16,7 @@ public function test_render_code_fieldtype() public function test_code_fieldtype_with_antlers_true() { - $code = new Code(); + $code = new Code; $field = new Field('code_field', [ 'type' => 'code', 'antlers' => true, diff --git a/tests/Antlers/Runtime/Fieldtypes/MarkdownFieldtypeTest.php b/tests/Antlers/Runtime/Fieldtypes/MarkdownFieldtypeTest.php index a668fdb99e..edfdb8dc1f 100644 --- a/tests/Antlers/Runtime/Fieldtypes/MarkdownFieldtypeTest.php +++ b/tests/Antlers/Runtime/Fieldtypes/MarkdownFieldtypeTest.php @@ -19,7 +19,7 @@ public function test_render_markdown_fieldtype() public function test_markdown_with_antlers_evaluates_correctly() { - $markdown = new Markdown(); + $markdown = new Markdown; $field = new Field('test', [ 'type' => 'markdown', 'antlers' => true, diff --git a/tests/Antlers/Runtime/MarkdownContentTest.php b/tests/Antlers/Runtime/MarkdownContentTest.php index db229b8722..123ef7709a 100644 --- a/tests/Antlers/Runtime/MarkdownContentTest.php +++ b/tests/Antlers/Runtime/MarkdownContentTest.php @@ -19,7 +19,7 @@ public function test_markdown_content_is_not_parsed_as_antlers() $content = StringUtilities::normalizeLineEndings($content); - $markdownFieldType = new Markdown(); + $markdownFieldType = new Markdown; $markdownField = new Value($content, 'markdown', $markdownFieldType); $this->assertSame($content, trim($this->renderString('{{ markdown }}', ['markdown' => $markdownField]))); @@ -54,7 +54,7 @@ public function test_markdown_content_is_not_parsed_as_antlers() $content = StringUtilities::normalizeLineEndings($content); $result = StringUtilities::normalizeLineEndings($result); - $markdownFieldType = new Markdown(); + $markdownFieldType = new Markdown; $markdownField = new Value($content, 'markdown', $markdownFieldType); $this->assertSame($result, trim($this->renderString('{{ markdown }}', ['markdown' => $markdownField]))); } diff --git a/tests/Antlers/Runtime/MethodCallTest.php b/tests/Antlers/Runtime/MethodCallTest.php index de249c7cb2..499c417d17 100644 --- a/tests/Antlers/Runtime/MethodCallTest.php +++ b/tests/Antlers/Runtime/MethodCallTest.php @@ -12,7 +12,7 @@ class MethodCallTest extends ParserTestCase { public function test_methods_can_be_called() { - $object = new ClassOne(); + $object = new ClassOne; $this->assertSame('Value: hello', $this->renderString('{{ object:method("hello"):methodTwo() }}', [ 'object' => $object, @@ -24,7 +24,7 @@ public function test_methods_can_be_called() public function test_chained_methods_colon_syntax() { - $object = new ClassOne(); + $object = new ClassOne; $this->assertSame('Value: hello', $this->renderString('{{ object:method("hello"):methodTwo() }}', [ 'object' => $object, @@ -33,7 +33,7 @@ public function test_chained_methods_colon_syntax() public function test_chained_methods_dot_syntax() { - $object = new ClassOne(); + $object = new ClassOne; $this->assertSame('Value: hello', $this->renderString('{{ object.method("hello").methodTwo() }}', [ 'object' => $object, @@ -42,7 +42,7 @@ public function test_chained_methods_dot_syntax() public function test_chained_methods_mixed_syntax() { - $object = new ClassOne(); + $object = new ClassOne; $this->assertSame('Value: hello', $this->renderString('{{ object:method("hello").methodTwo() }}', [ 'object' => $object, @@ -222,7 +222,7 @@ public function test_method_calls_can_have_modifiers_applied() public function test_method_calls_not_get_called_more_than_declared() { - $counter = new CallCounter(); + $counter = new CallCounter; $template = <<<'EOT' {{ counter:increment():increment():increment() }} diff --git a/tests/Antlers/Runtime/ParametersTest.php b/tests/Antlers/Runtime/ParametersTest.php index 76e64a826a..32647c9cf6 100644 --- a/tests/Antlers/Runtime/ParametersTest.php +++ b/tests/Antlers/Runtime/ParametersTest.php @@ -404,7 +404,7 @@ public function index() } })::register(); - $theGroup = new Group(); + $theGroup = new Group; $theField = new Field('the_group', [ 'type' => 'group', diff --git a/tests/Antlers/Runtime/PhpEnabledTest.php b/tests/Antlers/Runtime/PhpEnabledTest.php index 4ed5783e92..1eefb36965 100644 --- a/tests/Antlers/Runtime/PhpEnabledTest.php +++ b/tests/Antlers/Runtime/PhpEnabledTest.php @@ -95,7 +95,7 @@ public function test_php_inside_user_content_when_configured_to_do_so() // behavior, and is now disabled by default. However, it // can turned back on through the Antlers config file. - $config = new RuntimeConfiguration(); + $config = new RuntimeConfiguration; $config->allowPhpInUserContent = true; $fieldType = new class extends Fieldtype @@ -143,7 +143,7 @@ public function config(?string $key = null, $fallback = null) public function test_php_inside_user_content_can_be_disabled() { - $config = new RuntimeConfiguration(); + $config = new RuntimeConfiguration; $config->allowPhpInUserContent = false; $fieldType = new class extends Fieldtype @@ -302,7 +302,7 @@ public function test_implicit_antlers_php_node() 'title' => 'Antlers PHP Node Test', ]; - $entryFactory = new EntryFactory(); + $entryFactory = new EntryFactory; for ($i = 0; $i < 3; $i++) { $entryFactory->collection('blog')->create(); } @@ -431,7 +431,7 @@ public function test_antlers_php_node_can_return_assignments() 'title' => 'Antlers PHP Node Test', ]; - $entryFactory = new EntryFactory(); + $entryFactory = new EntryFactory; for ($i = 0; $i < 3; $i++) { $entryFactory->collection('blog')->create(); } diff --git a/tests/Antlers/Runtime/PreparserTest.php b/tests/Antlers/Runtime/PreparserTest.php index aa54a516bd..7eeed00955 100644 --- a/tests/Antlers/Runtime/PreparserTest.php +++ b/tests/Antlers/Runtime/PreparserTest.php @@ -25,14 +25,14 @@ public function test_pre_parser_can_modify_text() {{ title }} EOT; - $documentParser = new DocumentParser(); - $loader = new Loader(); - $envDetails = new EnvironmentDetails(); + $documentParser = new DocumentParser; + $loader = new Loader; + $envDetails = new EnvironmentDetails; $processor = new NodeProcessor($loader, $envDetails); $processor->setData($data); - $runtimeParser = new RuntimeParser($documentParser, $processor, new AntlersLexer(), new LanguageParser()); + $runtimeParser = new RuntimeParser($documentParser, $processor, new AntlersLexer, new LanguageParser); $runtimeParser->preparse(function ($text) { return str_replace('{{ title }}', '{{ subtitle | upper }}', $text); }); diff --git a/tests/Antlers/Runtime/RuntimeConfigurationTest.php b/tests/Antlers/Runtime/RuntimeConfigurationTest.php index 06da8ee397..c49c769e1a 100644 --- a/tests/Antlers/Runtime/RuntimeConfigurationTest.php +++ b/tests/Antlers/Runtime/RuntimeConfigurationTest.php @@ -10,7 +10,7 @@ class RuntimeConfigurationTest extends ParserTestCase { public function test_unpaired_loops_will_throw_fatal_error_when_configured() { - $config = new RuntimeConfiguration(); + $config = new RuntimeConfiguration; $config->fatalErrorOnUnpairedLoop = true; $vars = ['test' => ['one', 'two', 'three']]; diff --git a/tests/Antlers/Runtime/TagCheckScopeTest.php b/tests/Antlers/Runtime/TagCheckScopeTest.php index f58c5c035c..7d20bae8bb 100644 --- a/tests/Antlers/Runtime/TagCheckScopeTest.php +++ b/tests/Antlers/Runtime/TagCheckScopeTest.php @@ -18,7 +18,7 @@ class TagCheckScopeTest extends TestCase private function createData() { - $blueprint = new Blueprint(); + $blueprint = new Blueprint; $blueprint->setContents([ 'fields' => [ [ diff --git a/tests/Antlers/Runtime/TemplateTest.php b/tests/Antlers/Runtime/TemplateTest.php index 8e922ad4c9..f6db25f859 100644 --- a/tests/Antlers/Runtime/TemplateTest.php +++ b/tests/Antlers/Runtime/TemplateTest.php @@ -80,9 +80,7 @@ public function it_doesnt_output_anything_if_object_cannot_be_cast_to_a_string() 'line' => 1, 'file' => '', ]); - $object = new class - { - }; + $object = new class {}; $this->assertEquals('', $this->renderString('{{ object }}', compact('object'))); } diff --git a/tests/Fields/FieldTest.php b/tests/Fields/FieldTest.php index 55e1e66b0e..7bea0ecf34 100644 --- a/tests/Fields/FieldTest.php +++ b/tests/Fields/FieldTest.php @@ -52,9 +52,7 @@ public function it_determines_if_localizable() /** @test */ public function it_gets_the_fieldtype() { - $fieldtype = new class extends Fieldtype - { - }; + $fieldtype = new class extends Fieldtype {}; FieldtypeRepository::shouldReceive('find') ->with('the_fieldtype') diff --git a/tests/Fields/FieldtypeTest.php b/tests/Fields/FieldtypeTest.php index 838e848485..d6d7464e90 100644 --- a/tests/Fields/FieldtypeTest.php +++ b/tests/Fields/FieldtypeTest.php @@ -280,7 +280,7 @@ public function it_can_append_a_single_config_field() { TestAppendConfigFields::appendConfigField('group', ['type' => 'text']); - $fields = (new TestAppendConfigFields())->configFields(); + $fields = (new TestAppendConfigFields)->configFields(); $this->assertCount(3, $fields->all()); $this->assertEquals('text', $fields->get('group')->type()); @@ -298,7 +298,7 @@ public function it_can_append_multiple_config_fields() ], ]); - $fields = (new TestAppendConfigFields())->configFields(); + $fields = (new TestAppendConfigFields)->configFields(); $this->assertCount(4, $fields->all()); $this->assertEquals('text', $fields->get('group')->type()); @@ -319,7 +319,7 @@ public function it_wont_override_previously_appended_config_fields() TestAppendConfigFields::appendConfigField('another', ['type' => 'text']); - $fields = (new TestAppendConfigFields())->configFields(); + $fields = (new TestAppendConfigFields)->configFields(); $this->assertCount(5, $fields->all()); $this->assertEquals('text', $fields->get('group')->type()); @@ -330,13 +330,9 @@ public function it_wont_override_previously_appended_config_fields() /** @test */ public function it_will_only_append_config_fields_to_the_intended_fieldtype() { - $fieldtype = new class extends Fieldtype - { - }; + $fieldtype = new class extends Fieldtype {}; - $fieldtypeWithAppendedConfig = new class extends Fieldtype - { - }; + $fieldtypeWithAppendedConfig = new class extends Fieldtype {}; $fieldtypeWithAppendedConfig::appendConfigField('group', ['type' => 'text']); diff --git a/tests/Http/Middleware/AddViewPathsTest.php b/tests/Http/Middleware/AddViewPathsTest.php index 07792346cc..84c6b9ec6c 100644 --- a/tests/Http/Middleware/AddViewPathsTest.php +++ b/tests/Http/Middleware/AddViewPathsTest.php @@ -36,7 +36,7 @@ public function adds_view_paths($isAmpEnabled, $requestUrl, $expectedPaths) $request = $this->createRequest($requestUrl); $handled = false; - (new AddViewPaths())->handle($request, function () use ($expectedPaths, &$handled) { + (new AddViewPaths)->handle($request, function () use ($expectedPaths, &$handled) { $this->assertEquals($expectedPaths, view()->getFinder()->getPaths()); $handled = true; @@ -70,7 +70,7 @@ public function adds_namespaced_view_paths($requestUrl, $expectedPaths) $request = $this->createRequest($requestUrl); $handled = false; - (new AddViewPaths())->handle($request, function () use ($expectedPaths, &$handled) { + (new AddViewPaths)->handle($request, function () use ($expectedPaths, &$handled) { $this->assertEquals($expectedPaths, array_get(view()->getFinder()->getHints(), 'foo')); $handled = true; diff --git a/tests/Http/Middleware/SelectedSiteTest.php b/tests/Http/Middleware/SelectedSiteTest.php index e58098c668..ed643db073 100644 --- a/tests/Http/Middleware/SelectedSiteTest.php +++ b/tests/Http/Middleware/SelectedSiteTest.php @@ -37,7 +37,7 @@ public function it_sets_selected_site_first_authorized_one() $request = $this->createRequest('/cp/foo'); $handled = false; - (new SelectedSite())->handle($request, function () use (&$handled) { + (new SelectedSite)->handle($request, function () use (&$handled) { $handled = true; return new Response; @@ -74,7 +74,7 @@ public function it_doesnt_do_anything_when_there_are_no_authorized_sites() $request = $this->createRequest('/cp/foo'); $handled = false; - (new SelectedSite())->handle($request, function () use (&$handled) { + (new SelectedSite)->handle($request, function () use (&$handled) { $handled = true; return new Response; diff --git a/tests/Modifiers/AddTest.php b/tests/Modifiers/AddTest.php index 7706af048d..2edd9dec16 100644 --- a/tests/Modifiers/AddTest.php +++ b/tests/Modifiers/AddTest.php @@ -20,7 +20,7 @@ public function it_adds_a_number(): void public function it_adds_a_variable(): void { $context = [ - 'magazines' => new Value(10, 'magazines', new Integer()), + 'magazines' => new Value(10, 'magazines', new Integer), ]; $modified = $this->modify(5, ['magazines'], $context); $this->assertEquals(15, $modified); diff --git a/tests/Modifiers/BardHtmlTest.php b/tests/Modifiers/BardHtmlTest.php index 0dc8cd5ac0..99c62c2387 100644 --- a/tests/Modifiers/BardHtmlTest.php +++ b/tests/Modifiers/BardHtmlTest.php @@ -74,7 +74,7 @@ public function it_extracts_bard_html_from_value_object() ['type' => 'text', 'text' => 'This is a paragraph.'], ], ], - ], 'content', new Bard()); + ], 'content', new Bard); $expected = '

This is a paragraph.

'; diff --git a/tests/Modifiers/BardItemsTest.php b/tests/Modifiers/BardItemsTest.php index c88484dc14..0fc77b65bc 100644 --- a/tests/Modifiers/BardItemsTest.php +++ b/tests/Modifiers/BardItemsTest.php @@ -95,7 +95,7 @@ public function it_extracts_bard_items_from_value_object() ['type' => 'text', 'text' => 'This is a paragraph.'], ], ], - ], 'content', new Bard()); + ], 'content', new Bard); $expected = [ [ diff --git a/tests/Modifiers/BardTextTest.php b/tests/Modifiers/BardTextTest.php index 496d3ea9a8..8fd014e1c4 100644 --- a/tests/Modifiers/BardTextTest.php +++ b/tests/Modifiers/BardTextTest.php @@ -74,7 +74,7 @@ public function it_extracts_bard_text_from_value_object() ['type' => 'text', 'text' => 'This is a paragraph.'], ], ], - ], 'content', new Bard()); + ], 'content', new Bard); $expected = 'This is a paragraph.'; diff --git a/tests/Modifiers/IsIterableTest.php b/tests/Modifiers/IsIterableTest.php index bbe680f4bf..79372d5c04 100644 --- a/tests/Modifiers/IsIterableTest.php +++ b/tests/Modifiers/IsIterableTest.php @@ -13,7 +13,7 @@ public static function iterablesProvider(): array return [ 'array' => [true, ['foo', 'bar', 'baz']], 'collection' => [true, collect(['foo', 'bar', 'baz'])], - 'entries_collection' => [true, new EntryCollection()], + 'entries_collection' => [true, new EntryCollection], 'no_iterable' => [false, 'string'], ]; } diff --git a/tests/Modifiers/MarkTest.php b/tests/Modifiers/MarkTest.php index 78138de8a9..5e83eeb94d 100644 --- a/tests/Modifiers/MarkTest.php +++ b/tests/Modifiers/MarkTest.php @@ -77,7 +77,7 @@ public function it_marks_bard_value() ['type' => 'text', 'text' => 'amet', 'marks' => [['type' => 'bold']]], ], ], - ], 'content', new Bard()); + ], 'content', new Bard); $words = 'elüt amet'; $expected = '

Lorem, ipsum elüt sit amet

'; @@ -88,7 +88,7 @@ public function it_marks_bard_value() /** @test */ public function it_marks_markdown_value() { - $data = new Value('Lorem, ipsum elüt sit **amet**', 'content', new Markdown()); + $data = new Value('Lorem, ipsum elüt sit **amet**', 'content', new Markdown); $words = 'elüt amet'; $expected = '

Lorem, ipsum elüt sit amet

diff --git a/tests/OAuth/ProviderTest.php b/tests/OAuth/ProviderTest.php index 9644c3c7c0..96a74a3a27 100644 --- a/tests/OAuth/ProviderTest.php +++ b/tests/OAuth/ProviderTest.php @@ -167,7 +167,7 @@ private function user() private function socialite() { - return new Socialite(); + return new Socialite; } } diff --git a/tests/Search/IndexTests.php b/tests/Search/IndexTests.php index 305af0e297..7bf43173de 100644 --- a/tests/Search/IndexTests.php +++ b/tests/Search/IndexTests.php @@ -23,7 +23,5 @@ public function search_event_gets_emitted() }); } - protected function beforeSearched() - { - } + protected function beforeSearched() {} } diff --git a/tests/Search/SearchablesTest.php b/tests/Search/SearchablesTest.php index 6a979eb307..88c50ad284 100644 --- a/tests/Search/SearchablesTest.php +++ b/tests/Search/SearchablesTest.php @@ -354,9 +354,7 @@ public static function handle(): string return 'custom'; } - public function find(array $keys): Collection - { - } + public function find(array $keys): Collection {} public static function referencePrefix(): string { diff --git a/tests/Stache/AggregateStoreTest.php b/tests/Stache/AggregateStoreTest.php index 14b1cb3443..eb2b887336 100644 --- a/tests/Stache/AggregateStoreTest.php +++ b/tests/Stache/AggregateStoreTest.php @@ -50,6 +50,4 @@ public function discoverStores() } } -class TestChildStore extends ChildStore -{ -} +class TestChildStore extends ChildStore {} diff --git a/tests/Stache/StoreTest.php b/tests/Stache/StoreTest.php index e8bfab6663..642bdda983 100644 --- a/tests/Stache/StoreTest.php +++ b/tests/Stache/StoreTest.php @@ -90,9 +90,7 @@ public function it_gets_the_paths_from_the_cache_every_time_if_running_in_a_queu class TestStore extends Store { - public function getItem($key) - { - } + public function getItem($key) {} public function key() { diff --git a/tests/Stache/TraverserTest.php b/tests/Stache/TraverserTest.php index ec35b220d3..c046a07f76 100644 --- a/tests/Stache/TraverserTest.php +++ b/tests/Stache/TraverserTest.php @@ -98,13 +98,9 @@ public function files_can_be_filtered() $stache->shouldReceive('sites')->andReturn(collect(['en'])); $store = new class($stache, app('files')) extends BasicStore { - public function key() - { - } + public function key() {} - public function makeItemFromFile($path, $contents) - { - } + public function makeItemFromFile($path, $contents) {} }; $store->directory($this->tempDir); diff --git a/tests/Tags/GetErrorTest.php b/tests/Tags/GetErrorTest.php index a2cc79a352..1dca8d60a2 100644 --- a/tests/Tags/GetErrorTest.php +++ b/tests/Tags/GetErrorTest.php @@ -17,7 +17,7 @@ private function tag($tag, $data = []) /** @test */ public function the_tag_by_itself_does_nothing() { - view()->share('errors', (new ViewErrorBag())->put('default', new MessageBag([]))); + view()->share('errors', (new ViewErrorBag)->put('default', new MessageBag([]))); $this->assertEquals( '', @@ -28,7 +28,7 @@ public function the_tag_by_itself_does_nothing() /** @test */ public function it_outputs_nothing_when_the_field_doesnt_have_an_error() { - view()->share('errors', (new ViewErrorBag())->put('default', new MessageBag([]))); + view()->share('errors', (new ViewErrorBag)->put('default', new MessageBag([]))); $this->assertEquals( '', @@ -39,7 +39,7 @@ public function it_outputs_nothing_when_the_field_doesnt_have_an_error() /** @test */ public function it_outputs_nothing_when_there_are_errors_but_not_for_the_given_field_in_a_specific_bag() { - view()->share('errors', (new ViewErrorBag())->put('custom', new MessageBag([ + view()->share('errors', (new ViewErrorBag)->put('custom', new MessageBag([ 'name' => ['name is required'], ]))); @@ -52,7 +52,7 @@ public function it_outputs_nothing_when_there_are_errors_but_not_for_the_given_f /** @test */ public function it_outputs_nothing_when_the_field_doesnt_have_an_error_for_specific_bag() { - view()->share('errors', (new ViewErrorBag())->put('custom', new MessageBag([]))); + view()->share('errors', (new ViewErrorBag)->put('custom', new MessageBag([]))); $this->assertEquals( '', @@ -63,7 +63,7 @@ public function it_outputs_nothing_when_the_field_doesnt_have_an_error_for_speci /** @test */ public function it_outputs_nothing_when_there_are_errors_but_not_for_the_given_field() { - view()->share('errors', (new ViewErrorBag())->put('default', new MessageBag([ + view()->share('errors', (new ViewErrorBag)->put('default', new MessageBag([ 'name' => ['name is required'], ]))); @@ -76,7 +76,7 @@ public function it_outputs_nothing_when_there_are_errors_but_not_for_the_given_f /** @test */ public function it_gets_the_first_error_for_a_single_field() { - view()->share('errors', (new ViewErrorBag())->put('default', new MessageBag([ + view()->share('errors', (new ViewErrorBag)->put('default', new MessageBag([ 'name' => ['name is required'], 'email' => ['email is required', 'email should be an email address'], ]))); @@ -90,7 +90,7 @@ public function it_gets_the_first_error_for_a_single_field() /** @test */ public function it_gets_the_first_error_for_a_single_field_in_given_bag() { - view()->share('errors', (new ViewErrorBag())->put('custom', new MessageBag([ + view()->share('errors', (new ViewErrorBag)->put('custom', new MessageBag([ 'name' => ['name is required'], 'email' => ['email is required', 'email should be an email address'], ]))); diff --git a/tests/Tags/GetErrorsTest.php b/tests/Tags/GetErrorsTest.php index 541d62e47d..fd0df02b2a 100644 --- a/tests/Tags/GetErrorsTest.php +++ b/tests/Tags/GetErrorsTest.php @@ -21,7 +21,7 @@ private function tag($tag, $data = []) */ public function it_gets_errors_organized_into_fields($params, $bag, $errors, $expected) { - view()->share('errors', (new ViewErrorBag())->put($bag, new MessageBag($errors))); + view()->share('errors', (new ViewErrorBag)->put($bag, new MessageBag($errors))); $template = <<share('errors', (new ViewErrorBag())->put($bag, new MessageBag($errors))); + view()->share('errors', (new ViewErrorBag)->put($bag, new MessageBag($errors))); $template = <<share('errors', (new ViewErrorBag())->put($bag, new MessageBag($errors))); + view()->share('errors', (new ViewErrorBag)->put($bag, new MessageBag($errors))); $template = <<app->bind('TestTokenHandler', function () { - return new class() + return new class { public function handle($token, $request, $next) { diff --git a/tests/View/Antlers/ParserTests.php b/tests/View/Antlers/ParserTests.php index 7ee8fa05fc..abb58b7cad 100644 --- a/tests/View/Antlers/ParserTests.php +++ b/tests/View/Antlers/ParserTests.php @@ -1232,9 +1232,7 @@ public function it_doesnt_output_anything_if_object_cannot_be_cast_to_a_string() Log::shouldReceive('debug')->once() ->with('Cannot render an object variable as a string: {{ object }}'); - $object = new class - { - }; + $object = new class {}; $this->assertEquals('', $this->renderString('{{ object }}', compact('object'))); } @@ -1750,9 +1748,7 @@ public function it_can_reach_into_the_cascade() $m->shouldNotReceive('get')->with('augmented'); }); - $fieldtype = new class extends Fieldtype - { - }; + $fieldtype = new class extends Fieldtype {}; $augmented = new Value(['drink' => 'la croix'], 'augmented', $fieldtype); $context = [ @@ -1937,7 +1933,7 @@ public function index() /** @test */ public function it_counts_query_builder_results_in_conditions() { - (new EntryFactory())->collection('blog')->create(); + (new EntryFactory)->collection('blog')->create(); $template = '{{ if entries }}yup{{ else }}nope{{ /if }}'; @@ -2174,7 +2170,7 @@ public function empty_view_error_bags_are_considered_empty_in_conditions() public function objects_are_considered_truthy() { $this->assertEquals('yes', $this->renderString('{{ if object }}yes{{ else }}no{{ /if }}', [ - 'object' => new \stdClass(), + 'object' => new \stdClass, ])); } @@ -2214,9 +2210,7 @@ public function when_a_loop_is_a_value_object_with_an_empty_array_it_get_parsed_ after EOT; $this->assertEquals($expected, $this->renderString($template, [ - 'simple' => new Value([], null, new class extends \Statamic\Fieldtypes\Replicator - { - }), + 'simple' => new Value([], null, new class extends \Statamic\Fieldtypes\Replicator {}), ])); } @@ -2441,21 +2435,21 @@ public function it_uses_entries_as_conditions($object) public static function objectInConditionProvider() { return [ - 'with __toString' => [new class() + 'with __toString' => [new class { public function __toString() { return 'foo'; } }, ], - 'with __call' => [new class() + 'with __call' => [new class { public function __call($method, $args) { return 'foo'; } }, ], - 'without __call or __toString' => [new class() + 'without __call or __toString' => [new class { // }, ],