Skip to content

Commit 5dbcdc6

Browse files
committed
cleanup remaining param and internal Intl FulLTransformer
1 parent 053ad8d commit 5dbcdc6

File tree

29 files changed

+27
-123
lines changed

29 files changed

+27
-123
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ abstract protected function describeContainerTags(ContainerBuilder $builder, arr
132132
* * name: name of described service
133133
*
134134
* @param Definition|Alias|object $service
135-
* @param array $options
136135
*/
137136
abstract protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null);
138137

@@ -176,7 +175,6 @@ abstract protected function describeEventDispatcherListeners(EventDispatcherInte
176175
* Describes a callable.
177176
*
178177
* @param callable $callable
179-
* @param array $options
180178
*/
181179
abstract protected function describeCallable($callable, array $options = []);
182180

src/Symfony/Bundle/FrameworkBundle/Routing/Router.php

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberI
3737

3838
/**
3939
* @param mixed $resource The main resource to load
40-
* @param array $options An array of options
4140
*/
4241
public function __construct(ContainerInterface $container, $resource, array $options = [], RequestContext $context = null, ContainerInterface $parameters = null, LoggerInterface $logger = null, string $defaultLocale = null)
4342
{

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ public function __construct(FragmentHandler $handler)
3636
/**
3737
* Returns the fragment content for a given URI.
3838
*
39-
* @param string $uri A URI
40-
* @param array $options An array of options
39+
* @param string $uri
4140
*
4241
* @return string The fragment content
4342
*

src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ class Translator extends BaseTranslator implements WarmableInterface
6565
* * debug: Whether to enable debugging or not (false by default)
6666
* * resource_files: List of translation resources available grouped by locale.
6767
*
68-
* @param string $defaultLocale
69-
* @param array $loaderIds An array of loader Ids
70-
* @param array $options An array of options
71-
*
7268
* @throws InvalidArgumentException
7369
*/
7470
public function __construct(ContainerInterface $container, MessageFormatterInterface $formatter, string $defaultLocale, array $loaderIds = [], array $options = [])

src/Symfony/Component/Cache/Traits/MemcachedTrait.php

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ private function init(\Memcached $client, string $namespace, int $defaultLifetim
7171
* - [['localhost', 11211, 33]]
7272
*
7373
* @param array[]|string|string[] $servers An array of servers, a DSN, or an array of DSNs
74-
* @param array $options An array of options
7574
*
7675
* @return \Memcached
7776
*

src/Symfony/Component/Console/Descriptor/DescriptorInterface.php

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ interface DescriptorInterface
2424
* Describes an object if supported.
2525
*
2626
* @param object $object
27-
* @param array $options
2827
*/
2928
public function describe(OutputInterface $output, $object, array $options = []);
3029
}

src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
6161
*
6262
* @param string|null $foreground The style foreground color name
6363
* @param string|null $background The style background color name
64-
* @param array $options The style options
6564
*/
6665
public function __construct(string $foreground = null, string $background = null, array $options = [])
6766
{

src/Symfony/Component/Console/Helper/DescriptorHelper.php

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function __construct()
4949
* * raw_text: boolean, sets output type as raw
5050
*
5151
* @param object $object
52-
* @param array $options
5352
*
5453
* @throws InvalidArgumentException when the given format is not supported
5554
*/

src/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ interface DumperInterface
2121
/**
2222
* Dumps the service container.
2323
*
24-
* @param array $options An array of options
25-
*
2624
* @return string The representation of the service container
2725
*/
2826
public function dump(array $options = []);

src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class ResizeFormListener implements EventSubscriberInterface
3232
private $deleteEmpty;
3333

3434
/**
35-
* @param string $type
36-
* @param array $options
3735
* @param bool $allowAdd Whether children could be added to the group
3836
* @param bool $allowDelete Whether children could be removed from the group
3937
* @param bool|callable $deleteEmpty

src/Symfony/Component/Form/Tests/AbstractFormTest.php

+7-25
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\EventDispatcher\EventDispatcher;
1717
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1818
use Symfony\Component\Form\FormBuilder;
19+
use Symfony\Component\Form\FormInterface;
1920

2021
abstract class AbstractFormTest extends TestCase
2122
{
@@ -30,7 +31,7 @@ abstract class AbstractFormTest extends TestCase
3031
protected $factory;
3132

3233
/**
33-
* @var \Symfony\Component\Form\FormInterface
34+
* @var FormInterface
3435
*/
3536
protected $form;
3637

@@ -48,43 +49,24 @@ protected function tearDown(): void
4849
$this->form = null;
4950
}
5051

51-
/**
52-
* @return \Symfony\Component\Form\FormInterface
53-
*/
54-
abstract protected function createForm();
52+
abstract protected function createForm(): FormInterface;
5553

56-
/**
57-
* @param string $name
58-
* @param string|null $dataClass
59-
* @param array $options
60-
*
61-
* @return FormBuilder
62-
*/
63-
protected function getBuilder($name = 'name', EventDispatcherInterface $dispatcher = null, $dataClass = null, array $options = [])
54+
protected function getBuilder(?string $name = 'name', EventDispatcherInterface $dispatcher = null, string $dataClass = null, array $options = []): FormBuilder
6455
{
6556
return new FormBuilder($name, $dataClass, $dispatcher ?: $this->dispatcher, $this->factory, $options);
6657
}
6758

68-
/**
69-
* @return MockObject
70-
*/
71-
protected function getDataMapper()
59+
protected function getDataMapper(): MockObject
7260
{
7361
return $this->getMockBuilder('Symfony\Component\Form\DataMapperInterface')->getMock();
7462
}
7563

76-
/**
77-
* @return MockObject
78-
*/
79-
protected function getDataTransformer()
64+
protected function getDataTransformer(): MockObject
8065
{
8166
return $this->getMockBuilder('Symfony\Component\Form\DataTransformerInterface')->getMock();
8267
}
8368

84-
/**
85-
* @return MockObject
86-
*/
87-
protected function getFormValidator()
69+
protected function getFormValidator(): MockObject
8870
{
8971
return $this->getMockBuilder('Symfony\Component\Form\FormValidatorInterface')->getMock();
9072
}

src/Symfony/Component/Form/Tests/CompoundFormTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\Form\FormError;
1818
use Symfony\Component\Form\FormEvent;
1919
use Symfony\Component\Form\FormEvents;
20+
use Symfony\Component\Form\FormInterface;
2021
use Symfony\Component\Form\Forms;
2122
use Symfony\Component\Form\FormView;
2223
use Symfony\Component\Form\SubmitButtonBuilder;
@@ -190,7 +191,7 @@ public function testAddUsingNameAndType()
190191

191192
public function testAddUsingIntegerNameAndType()
192193
{
193-
$child = $this->getBuilder(0)->getForm();
194+
$child = $this->getBuilder('0')->getForm();
194195

195196
$this->factory->expects($this->once())
196197
->method('createNamed')
@@ -1123,7 +1124,7 @@ public function testFileUpload()
11231124
$this->assertNull($this->form->get('bar')->getData());
11241125
}
11251126

1126-
protected function createForm($name = 'name', $compound = true)
1127+
protected function createForm(string $name = 'name', bool $compound = true): FormInterface
11271128
{
11281129
$builder = $this->getBuilder($name);
11291130

src/Symfony/Component/Form/Tests/SimpleFormTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Form\FormError;
1919
use Symfony\Component\Form\FormEvent;
2020
use Symfony\Component\Form\FormEvents;
21+
use Symfony\Component\Form\FormInterface;
2122
use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer;
2223
use Symfony\Component\Form\Tests\Fixtures\FixedFilterListener;
2324
use Symfony\Component\PropertyAccess\PropertyPath;
@@ -1096,7 +1097,7 @@ public function testCannotCallGetViewDataInPreSetDataListener()
10961097
$form->setData('foo');
10971098
}
10981099

1099-
protected function createForm()
1100+
protected function createForm(): FormInterface
11001101
{
11011102
return $this->getBuilder()->getForm();
11021103
}

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class MemcachedSessionHandler extends AbstractSessionHandler
4141
* * expiretime: The time to live in seconds.
4242
*
4343
* @param \Memcached $memcached A \Memcached instance
44-
* @param array $options An associative array of Memcached options
4544
*
4645
* @throws \InvalidArgumentException When unsupported options are passed
4746
*/

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php

-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ class MongoDbSessionHandler extends AbstractSessionHandler
6161
* If you use such an index, you can drop `gc_probability` to 0 since
6262
* no garbage-collection is required.
6363
*
64-
* @param \MongoDB\Client $mongo A MongoDB\Client instance
65-
* @param array $options An associative array of field options
66-
*
6764
* @throws \InvalidArgumentException When "database" or "collection" not provided
6865
*/
6966
public function __construct(\MongoDB\Client $mongo, array $options)

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php

-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ class PdoSessionHandler extends AbstractSessionHandler
165165
* * lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL]
166166
*
167167
* @param \PDO|string|null $pdoOrDsn A \PDO instance or DSN string or URL string or null
168-
* @param array $options An associative array of options
169168
*
170169
* @throws \InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION
171170
*/

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class RedisSessionHandler extends AbstractSessionHandler
3535
* * prefix: The prefix to use for the keys in order to avoid collision on the Redis server.
3636
*
3737
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client|RedisProxy $redis
38-
* @param array $options An associative array of options
3938
*
4039
* @throws \InvalidArgumentException When unsupported client or options are passed
4140
*/

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ class NativeSessionStorage implements SessionStorageInterface
9797
* trans_sid_hosts, $_SERVER['HTTP_HOST']
9898
* trans_sid_tags, "a=href,area=href,frame=src,form="
9999
*
100-
* @param array $options Session configuration options
101100
* @param \SessionHandlerInterface|null $handler
102101
*/
103102
public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null)

src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public function addRenderer(FragmentRendererInterface $renderer)
6262
*
6363
* @param string|ControllerReference $uri A URI as a string or a ControllerReference instance
6464
* @param string $renderer The renderer name
65-
* @param array $options An array of options
6665
*
6766
* @return string|null The Response content or null when the Response is streamed
6867
*

src/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ interface FragmentRendererInterface
2525
/**
2626
* Renders a URI and returns the Response content.
2727
*
28-
* @param string|ControllerReference $uri A URI as a string or a ControllerReference instance
29-
* @param array $options An array of options
28+
* @param string|ControllerReference $uri A URI as a string or a ControllerReference instance
3029
*
3130
* @return Response A Response instance
3231
*/

src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php

+9-46
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,9 @@ public function __construct(string $pattern, string $timezone)
6969
];
7070
}
7171

72-
/**
73-
* Return the array of Transformer objects.
74-
*
75-
* @return Transformer[] Associative array of Transformer objects (format char => Transformer)
76-
*/
77-
public function getTransformers()
78-
{
79-
return $this->transformers;
80-
}
81-
8272
/**
8373
* Format a DateTime using ICU dateformat pattern.
8474
*
85-
* @param \DateTime $dateTime A DateTime object to be used to generate the formatted value
86-
*
8775
* @return string The formatted value
8876
*/
8977
public function format(\DateTime $dateTime)
@@ -98,14 +86,9 @@ public function format(\DateTime $dateTime)
9886
/**
9987
* Return the formatted ICU value for the matched date characters.
10088
*
101-
* @param string $dateChars The date characters to be replaced with a formatted ICU value
102-
* @param \DateTime $dateTime A DateTime object to be used to generate the formatted value
103-
*
104-
* @return string The formatted value
105-
*
10689
* @throws NotImplementedException When it encounters a not implemented date character
10790
*/
108-
public function formatReplace($dateChars, $dateTime)
91+
private function formatReplace(string $dateChars, \DateTime $dateTime): string
10992
{
11093
$length = \strlen($dateChars);
11194

@@ -167,12 +150,10 @@ public function parse(\DateTime $dateTime, $value)
167150
/**
168151
* Retrieve a regular expression to match with a formatted value.
169152
*
170-
* @param string $pattern The pattern to create the reverse matching regular expression
171-
*
172153
* @return string The reverse matching regular expression with named captures being formed by the
173154
* transformer index in the $transformer array
174155
*/
175-
public function getReverseMatchingRegExp($pattern)
156+
private function getReverseMatchingRegExp(string $pattern): string
176157
{
177158
$escapedPattern = preg_quote($pattern, '/');
178159

@@ -189,9 +170,8 @@ public function getReverseMatchingRegExp($pattern)
189170
return $this->replaceQuoteMatch($dateChars);
190171
}
191172

192-
$transformers = $this->getTransformers();
193-
if (isset($transformers[$transformerIndex])) {
194-
$transformer = $transformers[$transformerIndex];
173+
if (isset($this->transformers[$transformerIndex])) {
174+
$transformer = $this->transformers[$transformerIndex];
195175
$captureName = str_repeat($transformerIndex, $length);
196176

197177
return "(?P<$captureName>".$transformer->getReverseMatchingRegExp($length).')';
@@ -203,24 +183,16 @@ public function getReverseMatchingRegExp($pattern)
203183

204184
/**
205185
* Check if the first char of a string is a single quote.
206-
*
207-
* @param string $quoteMatch The string to check
208-
*
209-
* @return bool true if matches, false otherwise
210186
*/
211-
public function isQuoteMatch($quoteMatch)
187+
private function isQuoteMatch(string $quoteMatch): bool
212188
{
213189
return "'" === $quoteMatch[0];
214190
}
215191

216192
/**
217193
* Replaces single quotes at the start or end of a string with two single quotes.
218-
*
219-
* @param string $quoteMatch The string to replace the quotes
220-
*
221-
* @return string A string with the single quotes replaced
222194
*/
223-
public function replaceQuoteMatch($quoteMatch)
195+
private function replaceQuoteMatch(string $quoteMatch): string
224196
{
225197
if (preg_match("/^'+$/", $quoteMatch)) {
226198
return str_replace("''", "'", $quoteMatch);
@@ -231,12 +203,8 @@ public function replaceQuoteMatch($quoteMatch)
231203

232204
/**
233205
* Builds a chars match regular expression.
234-
*
235-
* @param string $specialChars A string of chars to build the regular expression
236-
*
237-
* @return string The chars match regular expression
238206
*/
239-
protected function buildCharsMatch($specialChars)
207+
private function buildCharsMatch(string $specialChars): string
240208
{
241209
$specialCharsArray = str_split($specialChars);
242210

@@ -250,10 +218,8 @@ protected function buildCharsMatch($specialChars)
250218
/**
251219
* Normalize a preg_replace match array, removing the numeric keys and returning an associative array
252220
* with the value and pattern values for the matched Transformer.
253-
*
254-
* @return array
255221
*/
256-
protected function normalizeArray(array $data)
222+
private function normalizeArray(array $data): array
257223
{
258224
$ret = [];
259225

@@ -275,12 +241,9 @@ protected function normalizeArray(array $data)
275241
* Calculates the Unix timestamp based on the matched values by the reverse matching regular
276242
* expression of parse().
277243
*
278-
* @param \DateTime $dateTime The DateTime object to be used to calculate the timestamp
279-
* @param array $options An array with the matched values to be used to calculate the timestamp
280-
*
281244
* @return bool|int The calculated timestamp or false if matched date is invalid
282245
*/
283-
protected function calculateUnixTimestamp(\DateTime $dateTime, array $options)
246+
private function calculateUnixTimestamp(\DateTime $dateTime, array $options)
284247
{
285248
$options = $this->getDefaultValueForOptions($options);
286249

0 commit comments

Comments
 (0)