Skip to content

[TASK] Make all PHP files strict #641

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/quickdump.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

/**
* This script is used for generating the examples in the README.
*/
Expand Down
2 changes: 1 addition & 1 deletion config/php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
'semicolon_after_instruction' => true,

// strict
// 'declare_strict_types' => true, // Note: We'll need to add some casts first.
'declare_strict_types' => true,
'strict_param' => true,

// string notation
Expand Down
2 changes: 2 additions & 0 deletions src/CSSList/AtRuleBlockList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\CSSList;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/CSSList/CSSBlockList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\CSSList;

use Sabberworm\CSS\Property\Selector;
Expand Down
2 changes: 2 additions & 0 deletions src/CSSList/CSSList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\CSSList;

use Sabberworm\CSS\Comment\Comment;
Expand Down
2 changes: 2 additions & 0 deletions src/CSSList/Document.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\CSSList;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/CSSList/KeyFrame.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\CSSList;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Comment/Comment.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Comment;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Comment/Commentable.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Comment;

interface Commentable
Expand Down
2 changes: 2 additions & 0 deletions src/OutputFormat.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/OutputFormatter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS;

use Sabberworm\CSS\Comment\Commentable;
Expand Down
2 changes: 2 additions & 0 deletions src/Parser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS;

use Sabberworm\CSS\CSSList\Document;
Expand Down
2 changes: 2 additions & 0 deletions src/Parsing/Anchor.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Parsing;

class Anchor
Expand Down
2 changes: 2 additions & 0 deletions src/Parsing/OutputException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Parsing;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Parsing/ParserState.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Parsing;

use Sabberworm\CSS\Comment\Comment;
Expand Down
2 changes: 2 additions & 0 deletions src/Parsing/SourceException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Parsing;

class SourceException extends \Exception
Expand Down
2 changes: 2 additions & 0 deletions src/Parsing/UnexpectedEOFException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Parsing;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Parsing/UnexpectedTokenException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Parsing;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Property/AtRule.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Property;

use Sabberworm\CSS\Comment\Commentable;
Expand Down
2 changes: 2 additions & 0 deletions src/Property/CSSNamespace.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Property;

use Sabberworm\CSS\Comment\Comment;
Expand Down
2 changes: 2 additions & 0 deletions src/Property/Charset.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Property;

use Sabberworm\CSS\Comment\Comment;
Expand Down
2 changes: 2 additions & 0 deletions src/Property/Import.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Property;

use Sabberworm\CSS\Comment\Comment;
Expand Down
2 changes: 2 additions & 0 deletions src/Property/KeyframeSelector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Property;

class KeyframeSelector extends Selector
Expand Down
2 changes: 2 additions & 0 deletions src/Property/Selector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Property;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Renderable.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS;

interface Renderable
Expand Down
2 changes: 2 additions & 0 deletions src/Rule/Rule.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Rule;

use Sabberworm\CSS\Comment\Comment;
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/AtRuleSet.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\RuleSet;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/DeclarationBlock.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\RuleSet;

use Sabberworm\CSS\CSSList\CSSList;
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet/RuleSet.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\RuleSet;

use Sabberworm\CSS\Comment\Comment;
Expand Down
2 changes: 2 additions & 0 deletions src/Settings.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Value/CSSFunction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/CSSString.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/CalcFunction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\Parsing\ParserState;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/CalcRuleValueList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/Color.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/LineName.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/PrimitiveValue.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

abstract class PrimitiveValue extends Value
Expand Down
2 changes: 2 additions & 0 deletions src/Value/RuleValueList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Value/Size.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/URL.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/Value.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\Parsing\ParserState;
Expand Down
2 changes: 2 additions & 0 deletions src/Value/ValueList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Value;

use Sabberworm\CSS\OutputFormat;
Expand Down
2 changes: 2 additions & 0 deletions tests/CSSList/AtRuleBlockListTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\CSSList;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/CSSList/DocumentTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\CSSList;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/CSSList/KeyFrameTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\CSSList;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/Comment/CommentTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\Comment;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/OutputFormatTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/RuleSet/DeclarationBlockTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\RuleSet;

use PHPUnit\Framework\TestCase;
Expand Down
Loading