Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Deprecate some contracts #16

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
}
],
"require": {
"php": ">=7.4 <9.0"
"php": ">=7.4 <9.0",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
Expand All @@ -33,7 +34,7 @@
},
"scripts": {
"phpcbf": "./vendor/bin/phpcbf",
"phpcs": "./vendor/bin/phpcs",
"phpcs": "./vendor/bin/phpcs -s",
"rector": "./vendor/bin/rector process",
"rector-dry-run": "./vendor/bin/rector process --dry-run",
"test": "./vendor/bin/phpunit --testsuite all"
Expand Down
5 changes: 4 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<file>test</file>
<file>rector.php</file>

<rule ref="PSR1"/>
<rule ref="PSR1">
<!-- PSR1 does not like that we trigger deprecation errors. -->
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
</rule>
<rule ref="PSR2"/>

</ruleset>
6 changes: 4 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" verbose="false">
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
verbose="false"
colors="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
Expand All @@ -11,7 +13,7 @@
</listeners>
<php>
<!-- Don't fail for external dependencies. -->
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
</php>
<testsuites>
<testsuite name="all">
Expand Down
2 changes: 2 additions & 0 deletions src/CountableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Contracts;

@trigger_error(__NAMESPACE__ . '\CountableInterface is deprecated. Use \Countable instead.', E_USER_DEPRECATED);

interface CountableInterface
{
public function count(): int;
Expand Down
5 changes: 5 additions & 0 deletions src/HydratableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

namespace Contracts;

@trigger_error(
__NAMESPACE__ . '\HydratableInterface is deprecated. Use \Procrastinator\HydratableInterface intead.',
E_USER_DEPRECATED
);

interface HydratableInterface extends \JsonSerializable
{
public static function hydrate(string $json, $instance = null);
Expand Down
5 changes: 5 additions & 0 deletions src/ParserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

namespace Contracts;

@trigger_error(
__NAMESPACE__ . '\ParserInterface is deprecated. Use \CsvParser\Parser\ParserInterface intead.',
E_USER_DEPRECATED
);

interface ParserInterface
{
public function feed(string $chunk);
Expand Down