Skip to content
Closed
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
3 changes: 2 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@
passthru="true"
checkreturn="true"
>
<arg value="--extensions=php"/>
<arg value="--extensions=php,stub"/>
<arg value="--encoding=utf-8"/>
<arg value="--tab-width=4"/>
<arg value="-sp"/>
<arg path="src"/>
<arg path="stubs"/>
<arg path="tests"/>
</exec>
</target>
Expand Down
49 changes: 27 additions & 22 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,33 @@ parameters:
constant_hassers: true
console_application_loader: null
stubFiles:
- stubs/ChoiceLoaderInterface.stub
- stubs/Constraint.stub
- stubs/ContainerBuilder.stub
- stubs/ContextAwareDecoderInterface.stub
- stubs/ContextAwareDenormalizerInterface.stub
- stubs/ContextAwareNormalizerInterface.stub
- stubs/DecoderInterface.stub
- stubs/DenormalizableInterface.stub
- stubs/DenormalizerInterface.stub
- stubs/EncoderInterface.stub
- stubs/EventSubscriberInterface.stub
- stubs/ExtensionInterface.stub
- stubs/FormBuilderInterface.stub
- stubs/FormInterface.stub
- stubs/FormTypeExtensionInterface.stub
- stubs/FormTypeInterface.stub
- stubs/FormView.stub
- stubs/HeaderBag.stub
- stubs/NormalizableInterface.stub
- stubs/NormalizerInterface.stub
- stubs/Process.stub
- stubs/Session.stub
- stubs/Component/DependencyInjection/Extension/ExtensionInterface.stub
- stubs/Component/DependencyInjection/ContainerBuilder.stub
- stubs/Component/EventDispatcher/EventSubscriberInterface.stub
- stubs/Component/Form/ChoiceList/Loader/ChoiceLoaderInterface.stub
- stubs/Component/Form/FormBuilderInterface.stub
- stubs/Component/Form/FormInterface.stub
- stubs/Component/Form/FormTypeExtensionInterface.stub
- stubs/Component/Form/FormTypeInterface.stub
- stubs/Component/Form/FormView.stub
- stubs/Component/HttpFoundation/Session/Session.stub
- stubs/Component/HttpFoundation/HeaderBag.stub
- stubs/Component/Process/Process.stub
- stubs/Component/Security/Acl/Model/AclInterface.stub
- stubs/Component/Security/Acl/Model/AclProviderInterface.stub
- stubs/Component/Security/Acl/Model/MutableAclInterface.stub
- stubs/Component/Security/Acl/Model/MutableAclProviderInterface.stub
- stubs/Component/Security/Acl/Model/ObjectIdentityInterface.stub
- stubs/Component/Serializer/Encoder/ContextAwareDecoderInterface.stub
- stubs/Component/Serializer/Encoder/DecoderInterface.stub
- stubs/Component/Serializer/Encoder/EncoderInterface.stub
- stubs/Component/Serializer/Normalizer/ContextAwareDenormalizerInterface.stub
- stubs/Component/Serializer/Normalizer/ContextAwareNormalizerInterface.stub
- stubs/Component/Serializer/Normalizer/DenormalizableInterface.stub
- stubs/Component/Serializer/Normalizer/DenormalizerInterface.stub
- stubs/Component/Serializer/Normalizer/NormalizableInterface.stub
- stubs/Component/Serializer/Normalizer/NormalizerInterface.stub
- stubs/Component/Validator/Constraint.stub

parametersSchema:
symfony: structure([
Expand Down
10 changes: 8 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<exclude-pattern>stubs</exclude-pattern>
<properties>
<property name="usefulAnnotations" type="array" value="
@dataProvider,
Expand All @@ -29,12 +30,14 @@
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<exclude-pattern>stubs</exclude-pattern>
<properties>
<property name="enableNativeTypeHint" value="false"/>
</properties>
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification"/>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude-pattern>stubs</exclude-pattern>
<properties>
<property name="enableObjectTypeHint" value="false"/>
</properties>
Expand All @@ -44,13 +47,16 @@
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit"/>
<rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming"/>
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming">
<exclude-pattern>stubs</exclude-pattern>
</rule>
<!-- <rule ref="SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator"/>-->
<!-- <rule ref="SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile"/> -->
<!-- <rule ref="SlevomatCodingStandard.PHP.ShortList"/> -->
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array" value="src=>PHPStan,tests=>PHPStan"/>
<property name="rootNamespaces" type="array" value="src=>PHPStan,stubs=>Symfony,tests=>PHPStan"/>
<property name="extensions" type="array" value="php,stub"/>
</properties>
</rule>
<exclude-pattern>tests/tmp</exclude-pattern>
Expand Down
22 changes: 0 additions & 22 deletions stubs/ChoiceLoaderInterface.stub

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
<?php declare(strict_types = 1);

namespace Symfony\Component\DependencyInjection;

class ContainerBuilder
{

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?php
<?php declare(strict_types = 1);

namespace Symfony\Component\DependencyInjection\Extension;

use Symfony\Component\DependencyInjection\ContainerBuilder;

interface ExtensionInterface
{
/**
* @param array<mixed> $configs
*/
public function load(array $configs, ContainerBuilder $container): void;

/**
* @param array<mixed> $configs
*/
public function load(array $configs, ContainerBuilder $container): void;

}
13 changes: 13 additions & 0 deletions stubs/Component/EventDispatcher/EventSubscriberInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\EventDispatcher;

interface EventSubscriberInterface
{

/**
* @return array<string, string|array<string, int>|array<int, string|array<string, int>|array<int, string>>>
*/
public static function getSubscribedEvents();

}
24 changes: 24 additions & 0 deletions stubs/Component/Form/ChoiceList/Loader/ChoiceLoaderInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Form\ChoiceList\Loader;

interface ChoiceLoaderInterface
{

/**
* @param array<string> $values
* @param callable|null $value
*
* @return array<mixed>
*/
public function loadChoicesForValues(array $values, $value = null);

/**
* @param array<mixed> $choices
* @param callable|null $value
*
* @return array<string>
*/
public function loadValuesForChoices(array $choices, $value = null);

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);

namespace Symfony\Component\Form;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);

namespace Symfony\Component\Form;

Expand Down
28 changes: 28 additions & 0 deletions stubs/Component/Form/FormTypeExtensionInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Form;

interface FormTypeExtensionInterface
{

/**
* @param FormBuilderInterface $builder
* @param array<string, mixed> $options
*/
public function buildForm(FormBuilderInterface $builder, array $options): void;

/**
* @param FormView $view
* @param FormInterface $form
* @param array<string, mixed> $options
*/
public function buildView(FormView $view, FormInterface $form, array $options): void;

/**
* @param FormView $view
* @param FormInterface $form
* @param array<string, mixed> $options
*/
public function finishView(FormView $view, FormInterface $form, array $options): void;

}
28 changes: 28 additions & 0 deletions stubs/Component/Form/FormTypeInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Form;

interface FormTypeInterface
{

/**
* @param FormBuilderInterface $builder
* @param array<string, mixed> $options
*/
public function buildForm(FormBuilderInterface $builder, array $options): void;

/**
* @param FormView $view
* @param FormInterface $form
* @param array<string, mixed> $options
*/
public function buildView(FormView $view, FormInterface $form, array $options): void;

/**
* @param FormView $view
* @param FormInterface $form
* @param array<string, mixed> $options
*/
public function finishView(FormView $view, FormInterface $form, array $options): void;

}
3 changes: 2 additions & 1 deletion stubs/FormView.stub → stubs/Component/Form/FormView.stub
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);

namespace Symfony\Component\Form;

Expand All @@ -11,4 +11,5 @@ use IteratorAggregate;
*/
class FormView implements ArrayAccess, IteratorAggregate
{

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);

namespace Symfony\Component\HttpFoundation;

Expand All @@ -11,6 +11,8 @@ class HeaderBag implements \IteratorAggregate
/**
* @phpstan-return \Traversable<string, string|string[]>
*/
public function getIterator() {}
public function getIterator()
{
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);

namespace Symfony\Component\HttpFoundation\Session;

Expand All @@ -11,6 +11,8 @@ class Session implements \IteratorAggregate
/**
* @phpstan-return \Traversable<string, mixed>
*/
public function getIterator() {}
public function getIterator()
{
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);

namespace Symfony\Component\Process;

Expand Down
8 changes: 8 additions & 0 deletions stubs/Component/Security/Acl/Model/AclInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Security\Acl\Model;

interface AclInterface
{

}
8 changes: 8 additions & 0 deletions stubs/Component/Security/Acl/Model/AclProviderInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Security\Acl\Model;

interface AclProviderInterface
{

}
8 changes: 8 additions & 0 deletions stubs/Component/Security/Acl/Model/MutableAclInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Security\Acl\Model;

interface MutableAclInterface extends AclInterface
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Security\Acl\Model;

interface MutableAclProviderInterface extends AclProviderInterface
{

/**
* @param ObjectIdentityInterface $oid
* @param array<mixed> $sids
*
* @return MutableAclInterface
*/
public function findAcl(ObjectIdentityInterface $oid, array $sids = []);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Security\Acl\Model;

interface ObjectIdentityInterface
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php declare(strict_types = 1);

namespace Symfony\Component\Serializer\Encoder;

interface ContextAwareDecoderInterface extends DecoderInterface
{

/**
* @param string $format
* @param array<mixed> $context
*
* @return bool
*/
public function supportsDecoding($format, array $context = []);

}
Loading