-
EOTXT;
} else {
$len = strlen("DumpDataCollectorTest.php on line {$line}:");
$xOutput = <<"DumpDataCollectorTest.php on line {$line}:"
+
"DumpDataCollectorTest.php on line {$line}:"
123
-
EOTXT;
}
@@ -111,7 +109,7 @@ public function testCollectHtml()
$output = preg_replace('#<(script|style).*?\1>#s', '', $output);
$output = preg_replace('/sf-dump-\d+/', 'sf-dump', $output);
- $this->assertSame($xOutput, $output);
+ $this->assertSame($xOutput, trim($output));
$this->assertSame(1, $collector->getDumpsCount());
$collector->serialize();
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/Controller/NullableController.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/Controller/NullableController.php
new file mode 100644
index 0000000000000..9db4df7b4c173
--- /dev/null
+++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/Controller/NullableController.php
@@ -0,0 +1,19 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\Tests\Fixtures\Controller;
+
+class NullableController
+{
+ public function action(?string $foo, ?\stdClass $bar, ?string $baz = 'value', $mandatory)
+ {
+ }
+}
diff --git a/src/Symfony/Component/Process/ExecutableFinder.php b/src/Symfony/Component/Process/ExecutableFinder.php
index 3bf711149dfab..824457ce2a122 100644
--- a/src/Symfony/Component/Process/ExecutableFinder.php
+++ b/src/Symfony/Component/Process/ExecutableFinder.php
@@ -79,7 +79,7 @@ public function find($name, $default = null, array $extraDirs = array())
}
foreach ($suffixes as $suffix) {
foreach ($dirs as $dir) {
- if (is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) {
+ if (@is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) {
return $file;
}
}
diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php
index 63454a5b45319..1d3d3a2083ca8 100644
--- a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php
+++ b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php
@@ -231,7 +231,7 @@ private function extractFromAccessor($class, $property)
*/
private function extractFromReflectionType(\ReflectionType $reflectionType)
{
- $phpTypeOrClass = (string) $reflectionType;
+ $phpTypeOrClass = method_exists($reflectionType, 'getName') ? $reflectionType->getName() : (string) $reflectionType;
$nullable = $reflectionType->allowsNull();
if ($reflectionType->isBuiltin()) {
diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php
index dfc13c025eb41..10b056220d539 100644
--- a/src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php
+++ b/src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php
@@ -94,6 +94,25 @@ public function php7TypesProvider()
);
}
+ /**
+ * @dataProvider php71TypesProvider
+ * @requires PHP 7.1
+ */
+ public function testExtractPhp71Type($property, array $type = null)
+ {
+ $this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php71Dummy', $property, array()));
+ }
+
+ public function php71TypesProvider()
+ {
+ return array(
+ array('foo', array(new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true))),
+ array('bar', array(new Type(Type::BUILTIN_TYPE_INT, true))),
+ array('baz', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING)))),
+ array('donotexist', null),
+ );
+ }
+
public function testIsReadable()
{
$this->assertFalse($this->extractor->isReadable('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', 'bar', array()));
diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php71Dummy.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php71Dummy.php
new file mode 100644
index 0000000000000..d93c67a3d38bd
--- /dev/null
+++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php71Dummy.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
+
+/**
+ * @author Teoh Han Hui
+ */
+class Php71Dummy
+{
+ public function getFoo(): ?array
+ {
+ }
+
+ public function setBar(?int $bar)
+ {
+ }
+
+ public function addBaz(string $baz)
+ {
+ }
+}
diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.lv.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.lv.xlf
new file mode 100644
index 0000000000000..33c48c617461c
--- /dev/null
+++ b/src/Symfony/Component/Security/Core/Resources/translations/security.lv.xlf
@@ -0,0 +1,71 @@
+
+
+
+
+
+ An authentication exception occurred.
+ Radās autentifikācijas kļūda.
+
+
+ Authentication credentials could not be found.
+ Autentifikācijas dati nav atrasti.
+
+
+ Authentication request could not be processed due to a system problem.
+ Autentifikācijas pieprasījums nevar tikt apstrādāts sistēmas problēmas dēļ.
+
+
+ Invalid credentials.
+ Nederīgi autentifikācijas dati.
+
+
+ Cookie has already been used by someone else.
+ Kāds cits jau izmantoja sīkdatni.
+
+
+ Not privileged to request the resource.
+ Nav tiesību ši resursa izsaukšanai.
+
+
+ Invalid CSRF token.
+ Nederīgs CSRF talons.
+
+
+ Digest nonce has expired.
+ Vienreiz lietojamās atslēgas darbības laiks ir beidzies.
+
+
+ No authentication provider found to support the authentication token.
+ Nav atrasts, autentifikācijas talonu atbalstošs, autentifikācijas sniedzējs.
+
+
+ No session available, it either timed out or cookies are not enabled.
+ Sesija nav pieejama - vai nu tā beidzās, vai nu sīkdatnes nav iespējotas.
+
+
+ No token could be found.
+ Nevar atrast nevienu talonu.
+
+
+ Username could not be found.
+ Nevar atrast lietotājvārdu.
+
+
+ Account has expired.
+ Konta derīguma termiņš ir beidzies.
+
+
+ Credentials have expired.
+ Autentifikācijas datu derīguma termiņš ir beidzies.
+
+
+ Account is disabled.
+ Konts ir atspējots.
+
+
+ Account is locked.
+ Konts ir slēgts.
+
+
+
+
\ No newline at end of file
diff --git a/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php b/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php
index 793007e7f5420..95e76ee279316 100644
--- a/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php
+++ b/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php
@@ -65,9 +65,17 @@ protected function buildRoleMap()
}
$visited[] = $role;
- $this->map[$main] = array_unique(array_merge($this->map[$main], $this->hierarchy[$role]));
- $additionalRoles = array_merge($additionalRoles, array_diff($this->hierarchy[$role], $visited));
+
+ foreach ($this->hierarchy[$role] as $roleToAdd) {
+ $this->map[$main][] = $roleToAdd;
+ }
+
+ foreach (array_diff($this->hierarchy[$role], $visited) as $additionalRole) {
+ $additionalRoles[] = $additionalRole;
+ }
}
+
+ $this->map[$main] = array_unique($this->map[$main]);
}
}
}
diff --git a/src/Symfony/Component/Security/Resources/translations/security.lv.xlf b/src/Symfony/Component/Security/Resources/translations/security.lv.xlf
new file mode 100644
index 0000000000000..33c48c617461c
--- /dev/null
+++ b/src/Symfony/Component/Security/Resources/translations/security.lv.xlf
@@ -0,0 +1,71 @@
+
+
+
+
+
+ An authentication exception occurred.
+ Radās autentifikācijas kļūda.
+
+
+ Authentication credentials could not be found.
+ Autentifikācijas dati nav atrasti.
+
+
+ Authentication request could not be processed due to a system problem.
+ Autentifikācijas pieprasījums nevar tikt apstrādāts sistēmas problēmas dēļ.
+
+
+ Invalid credentials.
+ Nederīgi autentifikācijas dati.
+
+
+ Cookie has already been used by someone else.
+ Kāds cits jau izmantoja sīkdatni.
+
+
+ Not privileged to request the resource.
+ Nav tiesību ši resursa izsaukšanai.
+
+
+ Invalid CSRF token.
+ Nederīgs CSRF talons.
+
+
+ Digest nonce has expired.
+ Vienreiz lietojamās atslēgas darbības laiks ir beidzies.
+
+
+ No authentication provider found to support the authentication token.
+ Nav atrasts, autentifikācijas talonu atbalstošs, autentifikācijas sniedzējs.
+
+
+ No session available, it either timed out or cookies are not enabled.
+ Sesija nav pieejama - vai nu tā beidzās, vai nu sīkdatnes nav iespējotas.
+
+
+ No token could be found.
+ Nevar atrast nevienu talonu.
+
+
+ Username could not be found.
+ Nevar atrast lietotājvārdu.
+
+
+ Account has expired.
+ Konta derīguma termiņš ir beidzies.
+
+
+ Credentials have expired.
+ Autentifikācijas datu derīguma termiņš ir beidzies.
+
+
+ Account is disabled.
+ Konts ir atspējots.
+
+
+ Account is locked.
+ Konts ir slēgts.
+
+
+
+
\ No newline at end of file
diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/ChainDecoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/ChainDecoderTest.php
index 7f7392e6a45b1..a6d3f40f2366d 100644
--- a/src/Symfony/Component/Serializer/Tests/Encoder/ChainDecoderTest.php
+++ b/src/Symfony/Component/Serializer/Tests/Encoder/ChainDecoderTest.php
@@ -68,7 +68,7 @@ public function testDecode()
}
/**
- * @expectedException Symfony\Component\Serializer\Exception\RuntimeException
+ * @expectedException \Symfony\Component\Serializer\Exception\RuntimeException
*/
public function testDecodeUnsupportedFormat()
{
diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/ChainEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/ChainEncoderTest.php
index 6d3436b33d753..4fc6b25f9b47f 100644
--- a/src/Symfony/Component/Serializer/Tests/Encoder/ChainEncoderTest.php
+++ b/src/Symfony/Component/Serializer/Tests/Encoder/ChainEncoderTest.php
@@ -69,7 +69,7 @@ public function testEncode()
}
/**
- * @expectedException Symfony\Component\Serializer\Exception\RuntimeException
+ * @expectedException \Symfony\Component\Serializer\Exception\RuntimeException
*/
public function testEncodeUnsupportedFormat()
{
diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/JsonDecodeTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/JsonDecodeTest.php
index 97930115748d2..c87ab21b510a2 100644
--- a/src/Symfony/Component/Serializer/Tests/Encoder/JsonDecodeTest.php
+++ b/src/Symfony/Component/Serializer/Tests/Encoder/JsonDecodeTest.php
@@ -57,7 +57,7 @@ public function decodeProvider()
/**
* @requires function json_last_error_msg
* @dataProvider decodeProviderException
- * @expectedException Symfony\Component\Serializer\Exception\UnexpectedValueException
+ * @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
*/
public function testDecodeWithException($value)
{
diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncodeTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncodeTest.php
index 3e6fb7b6ec34e..d255b21d22e7f 100644
--- a/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncodeTest.php
+++ b/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncodeTest.php
@@ -50,7 +50,7 @@ public function encodeProvider()
/**
* @requires function json_last_error_msg
- * @expectedException Symfony\Component\Serializer\Exception\UnexpectedValueException
+ * @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
*/
public function testEncodeWithError()
{
diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php
index 4d6ab3eaac1db..fc5288d13bee7 100644
--- a/src/Symfony/Component/Validator/Constraint.php
+++ b/src/Symfony/Component/Validator/Constraint.php
@@ -129,6 +129,9 @@ public function __construct($options = null)
unset($options['value']);
}
+ if (is_array($options)) {
+ reset($options);
+ }
if (is_array($options) && count($options) > 0 && is_string(key($options))) {
foreach ($options as $option => $value) {
if (array_key_exists($option, $knownOptions)) {
diff --git a/src/Symfony/Component/Validator/Constraints/UrlValidator.php b/src/Symfony/Component/Validator/Constraints/UrlValidator.php
index 7497becef93f3..ed0a2579b4c94 100644
--- a/src/Symfony/Component/Validator/Constraints/UrlValidator.php
+++ b/src/Symfony/Component/Validator/Constraints/UrlValidator.php
@@ -25,13 +25,13 @@ class UrlValidator extends ConstraintValidator
(%s):// # protocol
(([\pL\pN-]+:)?([\pL\pN-]+)@)? # basic auth
(
- ([\pL\pN\pS-\.])+(\.?([\pL]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
- | # or
- \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # a IP address
- | # or
+ ([\pL\pN\pS-\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
+ | # or
+ \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address
+ | # or
\[
(?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))
- \] # a IPv6 address
+ \] # an IPv6 address
)
(:[0-9]+)? # a port (optional)
(/?|/\S+|\?\S*|\#\S*) # a /, nothing, a / with something, a query or a fragment
diff --git a/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php b/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php
index b5b202de6d2b6..68236fc1eb069 100644
--- a/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php
+++ b/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php
@@ -116,9 +116,27 @@ public function getMetadataFor($value)
$metadata->mergeConstraints($this->getMetadataFor($parent->name));
}
- // Include constraints from all implemented interfaces that have not been processed via parent class yet
- foreach ($metadata->getReflectionClass()->getInterfaces() as $interface) {
- if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->name || ($parent && $parent->implementsInterface($interface->name))) {
+ $interfaces = $metadata->getReflectionClass()->getInterfaces();
+
+ $interfaces = array_filter($interfaces, function ($interface) use ($parent, $interfaces) {
+ $interfaceName = $interface->getName();
+
+ if ($parent && $parent->implementsInterface($interfaceName)) {
+ return false;
+ }
+
+ foreach ($interfaces as $i) {
+ if ($i !== $interface && $i->implementsInterface($interfaceName)) {
+ return false;
+ }
+ }
+
+ return true;
+ });
+
+ // Include constraints from all directly implemented interfaces
+ foreach ($interfaces as $interface) {
+ if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->name) {
continue;
}
$metadata->mergeConstraints($this->getMetadataFor($interface->name));
diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf
new file mode 100644
index 0000000000000..2ad19cd283c18
--- /dev/null
+++ b/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf
@@ -0,0 +1,315 @@
+
+
+
+
+
+ This value should be false.
+ Šai vērtībai ir jābūt nepatiesai.
+
+
+ This value should be true.
+ Šai vērtībai ir jābūt patiesai.
+
+
+ This value should be of type {{ type }}.
+ Šīs vērtības tipam ir jābūt {{ type }}.
+
+
+ This value should be blank.
+ Šai vērtībai ir jābūt tukšai.
+
+
+ The value you selected is not a valid choice.
+ Vērtība, kuru jūs izvēlējāties nav derīga izvēle.
+
+
+ You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.
+ Jums nav jāveic izvēle.|Jums ir jāveic vismaz {{ limit }} izvēle.|Jums ir jāveic vismaz {{ limit }} izvēles.
+
+
+ You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.
+ Jums nav jāveic izvēle.|Jums ir jāveic ne vairāk kā {{ limit }} izvēle.|Jums ir jāveic ne vairāk kā {{ limit }} izvēles.
+
+
+ One or more of the given values is invalid.
+ Viena vai vairākas no dotajām vērtībām ir nederīgas.
+
+
+ This field was not expected.
+ Šis lauks netika gaidīts.
+
+
+ This field is missing.
+ Šis lauks ir pazudis.
+
+
+ This value is not a valid date.
+ Šī vērtība ir nederīgs datums.
+
+
+ This value is not a valid datetime.
+ Šī vērtība ir nederīgs datums un laiks
+
+
+ This value is not a valid email address.
+ Šī vērtība ir nederīga e-pasta adrese.
+
+
+ The file could not be found.
+ Fails nav atrasts.
+
+
+ The file is not readable.
+ Fails nav lasāms.
+
+
+ The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.
+ Fails ir pārāk liels ({{ size }} {{ suffix }}). Atļautais maksimālais izmērs ir {{ limit }} {{ suffix }}.
+
+
+ The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.
+ Faila mime tips nav derīgs ({{ type }}). Atļautie mime tipi ir {{ types }}.
+
+
+ This value should be {{ limit }} or less.
+ Šai vērtībai ir jābūt ne vairāk kā {{ limit }}.
+
+
+ This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.
+ Šīs vērtības garums ir 0 rakstzīmju.|Šī vērtība ir pārāk gara. Tai būtu jābūt ne vairāk kā {{ limit }} rakstzīmei.|Šī vērtība ir pārāk gara. Tai būtu jābūt ne vairāk kā {{ limit }} rakstzīmēm.
+
+
+ This value should be {{ limit }} or more.
+ Šai vērtībai ir jābūt ne mazāk kā {{ limit }}.
+
+
+ This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.
+ Šīs vērtības garums ir 0 rakstzīmju.|Šī vērtība ir pārāk īsa. Tai būtu jābūt ne mazāk kā {{ limit }} rakstzīmei.|Šī vērtība ir pārāk īsa. Tai būtu jābūt ne mazāk kā {{ limit }} rakstzīmēm.
+
+
+ This value should not be blank.
+ Šai vērtībai nav jābūt tukšai.
+
+
+ This value should not be null.
+ Šai vērtībai nav jābūt null.
+
+
+ This value should be null.
+ Šai vērtībai ir jābūt null.
+
+
+ This value is not valid.
+ Šī vērtība ir nederīga.
+
+
+ This value is not a valid time.
+ Šī vērtība ir nederīgs laiks.
+
+
+ This value is not a valid URL.
+ Šī vērtība ir nederīgs URL.
+
+
+ The two values should be equal.
+ Abām vērtībām jābūt vienādam.
+
+
+ The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.
+ Fails ir pārāk liels. Atļautais maksimālais izmērs ir {{ limit }} {{ suffix }}.
+
+
+ The file is too large.
+ Fails ir pārāk liels.
+
+
+ The file could not be uploaded.
+ Failu nevarēja augšupielādēt.
+
+
+ This value should be a valid number.
+ Šai vērtībai ir jābūt derīgam skaitlim.
+
+
+ This file is not a valid image.
+ Šis fails nav derīgs attēls.
+
+
+ This is not a valid IP address.
+ Šī nav derīga IP adrese.
+
+
+ This value is not a valid language.
+ Šī vērtība nav derīga valoda.
+
+
+ This value is not a valid locale.
+ Šī vērtība nav derīga lokalizācija.
+
+
+ This value is not a valid country.
+ Šī vērtība nav derīga valsts.
+
+
+ This value is already used.
+ Šī vērtība jau tiek izmantota.
+
+
+ The size of the image could not be detected.
+ Nevar noteikt attēla izmēru.
+
+
+ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.
+ Attēla platums ir pārāk liels ({{ width }}px). Atļautais maksimālais platums ir {{ max_width }}px.
+
+
+ The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.
+ Attēla platums ir pārāk mazs ({{ width }}px). Minimālais sagaidāmais platums ir {{ min_width }}px.
+
+
+ The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.
+ Attēla augstums ir pārāk liels ({{ height }}px). Atļautais maksimālais augstums ir {{ max_height }}px.
+
+
+ The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.
+ Attēla augstums ir pārāk mazs ({{ height }}px). Minimālais sagaidāmais augstums ir {{ min_height }}px.
+
+
+ This value should be the user's current password.
+ Šai vērtībai ir jābūt lietotāja pašreizējai parolei.
+
+
+ This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.
+ Šīs vērtības garums ir 0 rakstzīmju.|Šai vērtībai ir jābūt tieši {{ limit }} rakstzīmei.|Šai vērtībai ir jābūt tieši {{ limit }} rakstzīmēm.
+
+
+ The file was only partially uploaded.
+ Fails bija tikai daļēji augšupielādēts.
+
+
+ No file was uploaded.
+ Fails netika augšupielādēts.
+
+
+ No temporary folder was configured in php.ini.
+ Pagaidu mape php.ini failā nav nokonfigurēta.
+
+
+ Cannot write temporary file to disk.
+ Nevar ierakstīt pagaidu failu uz diska.
+
+
+ A PHP extension caused the upload to fail.
+ PHP paplašinājums izraisīja augšupielādes neizdošanos.
+
+
+ This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.
+ Šis krājums satur 0 elementu.|Šim krājumam jāsatur vismaz {{ limit }} elementu.|Šim krājumam jāsatur vismaz {{ limit }} elementus.
+
+
+ This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.
+ Šis krājums satur 0 elementu.|Šim krājumam jāsatur ne vairāk kā {{ limit }} elementu.|Šim krājumam jāsatur ne vairāk kā {{ limit }} elementus.
+
+
+ This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.
+ Šis krājums satur 0 elementu.|Šim krājumam jāsatur tieši {{ limit }} elementu.|Šim krājumam jāsatur tieši {{ limit }} elementus.
+
+
+ Invalid card number.
+ Nederīgs kartes numurs.
+
+
+ Unsupported card type or invalid card number.
+ Neatbalstīts kartes tips vai nederīgs kartes numurs.
+
+
+ This is not a valid International Bank Account Number (IBAN).
+ Šis nav derīgs starptautisks banku konta numurs (IBAN).
+
+
+ This value is not a valid ISBN-10.
+ Šī vērtība nav derīgs ISBN-10 numurs.
+
+
+ This value is not a valid ISBN-13.
+ Šī vērtība nav derīgs ISBN-13 numurs
+
+
+ This value is neither a valid ISBN-10 nor a valid ISBN-13.
+ Šī vērtība neatbilst ne derīgam ISBN-10 numuram, ne derīgm ISBN-13 numuram.
+
+
+ This value is not a valid ISSN.
+ Šī vērtība nav derīgs ISSN numurs
+
+
+ This value is not a valid currency.
+ Šī vērtība nav derīga valūta
+
+
+ This value should be equal to {{ compared_value }}.
+ Šai vērtībai ir jābūt vienādai ar {{ compared_value }}.
+
+
+ This value should be greater than {{ compared_value }}.
+ Šai vērtībai ir jābūt lielākai par {{ compared_value }}.
+
+
+ This value should be greater than or equal to {{ compared_value }}.
+ Šai vērtībai ir jābūt lielākai vai vienādai ar {{ compared_value }}.
+
+
+ This value should be identical to {{ compared_value_type }} {{ compared_value }}.
+ Šai vērtībai ir jābūt identiskai ar {{ compared_value_type }} {{ compared_value }}.
+
+
+ This value should be less than {{ compared_value }}.
+ Šai vērtībai ir jābūt mazākai par {{ compared_value }}.
+
+
+ This value should be less than or equal to {{ compared_value }}.
+ TŠai vērtībai ir jābūt mazākai vai vienādai ar {{ compared_value }}.
+
+
+ This value should not be equal to {{ compared_value }}.
+ Šai vērtībai ir jābūt vienādai ar {{ compared_value }}.
+
+
+ This value should not be identical to {{ compared_value_type }} {{ compared_value }}.
+ Šai vērtībai nav jābūt identiskai ar {{ compared_value_type }} {{ compared_value }}.
+
+
+ The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.
+ Attēla attiecība ir pārāk liela ({{ ratio }}). Atļautā maksimālā attiecība ir {{ max_ratio }}.
+
+
+ The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.
+ Attēla attiecība ir pārāk maza ({{ ratio }}). Minimālā sagaidāmā attiecība ir {{ min_ratio }}.
+
+
+ The image is square ({{ width }}x{{ height }}px). Square images are not allowed.
+ Šis attēls ir kvadrāts ({{ width }}x{{ height }}px). Kvadrātveida attēli nav atļauti.
+
+
+ The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.
+ Attēls ir orientēts kā ainava ({{ width }}x{{ height }}px). Attēli, kas ir orientēti kā ainavas nav atļauti.
+
+
+ The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.
+ Attēls ir orientēts kā portrets ({{ width }}x{{ height }}px). Attēli, kas ir orientēti kā portreti nav atļauti.
+
+
+ An empty file is not allowed.
+ Tukšs fails nav atļauts.
+
+
+ The host could not be resolved.
+ Resursdatora nosaukumu nevar atrisināt.
+
+
+ This value does not match the expected {{ charset }} charset.
+ Šī vērtība neatbilst sagaidāmajai rakstzīmju kopai {{ charset }}.
+
+
+
+
diff --git a/src/Symfony/Component/Validator/Tests/ConstraintTest.php b/src/Symfony/Component/Validator/Tests/ConstraintTest.php
index f63570c5d2944..d473f14f651ac 100644
--- a/src/Symfony/Component/Validator/Tests/ConstraintTest.php
+++ b/src/Symfony/Component/Validator/Tests/ConstraintTest.php
@@ -206,4 +206,35 @@ public function testGetErrorNameForUnknownCode()
{
Constraint::getErrorName(1);
}
+
+ public function testOptionsAsDefaultOption()
+ {
+ $constraint = new ConstraintA($options = array('value1'));
+
+ $this->assertEquals($options, $constraint->property2);
+
+ $constraint = new ConstraintA($options = array('value1', 'property1' => 'value2'));
+
+ $this->assertEquals($options, $constraint->property2);
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Validator\Exception\InvalidOptionsException
+ * @expectedExceptionMessage The options "0", "5" do not exist
+ */
+ public function testInvalidOptions()
+ {
+ new ConstraintA(array('property2' => 'foo', 'bar', 5 => 'baz'));
+ }
+
+ public function testOptionsWithInvalidInternalPointer()
+ {
+ $options = array('property1' => 'foo');
+ next($options);
+ next($options);
+
+ $constraint = new ConstraintA($options);
+
+ $this->assertEquals('foo', $constraint->property1);
+ }
}
diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php
index 439d45cc050fc..bcb5f59e43478 100644
--- a/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php
+++ b/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php
@@ -221,7 +221,7 @@ public function getInvalidReservedIpsV4()
{
return array(
array('0.0.0.0'),
- array('224.0.0.1'),
+ array('240.0.0.1'),
array('255.255.255.255'),
);
}
diff --git a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php
index 23610c31f6228..7a27520896711 100644
--- a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php
+++ b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php
@@ -90,6 +90,7 @@ public function getValidUrls()
array('http://www.symfony.com/doc/current/book/validation.html#supported-constraints'),
array('http://very.long.domain.name.com/'),
array('http://localhost/'),
+ array('http://myhost123/'),
array('http://127.0.0.1/'),
array('http://127.0.0.1:80/'),
array('http://[::1]/'),
diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/Entity.php b/src/Symfony/Component/Validator/Tests/Fixtures/Entity.php
index e4eec6be32eb1..77a86108a1ae0 100644
--- a/src/Symfony/Component/Validator/Tests/Fixtures/Entity.php
+++ b/src/Symfony/Component/Validator/Tests/Fixtures/Entity.php
@@ -19,7 +19,7 @@
* @Assert\GroupSequence({"Foo", "Entity"})
* @Assert\Callback({"Symfony\Component\Validator\Tests\Fixtures\CallbackClass", "callback"})
*/
-class Entity extends EntityParent
+class Entity extends EntityParent implements EntityInterfaceB
{
/**
* @Assert\NotNull
diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/EntityInterface.php b/src/Symfony/Component/Validator/Tests/Fixtures/EntityInterfaceA.php
similarity index 91%
rename from src/Symfony/Component/Validator/Tests/Fixtures/EntityInterface.php
rename to src/Symfony/Component/Validator/Tests/Fixtures/EntityInterfaceA.php
index 2901f26386b4e..a0afcf8163110 100644
--- a/src/Symfony/Component/Validator/Tests/Fixtures/EntityInterface.php
+++ b/src/Symfony/Component/Validator/Tests/Fixtures/EntityInterfaceA.php
@@ -11,6 +11,6 @@
namespace Symfony\Component\Validator\Tests\Fixtures;
-interface EntityInterface
+interface EntityInterfaceA
{
}
diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/EntityInterfaceB.php b/src/Symfony/Component/Validator/Tests/Fixtures/EntityInterfaceB.php
new file mode 100644
index 0000000000000..93b389414fadf
--- /dev/null
+++ b/src/Symfony/Component/Validator/Tests/Fixtures/EntityInterfaceB.php
@@ -0,0 +1,16 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Validator\Tests\Fixtures;
+
+interface EntityInterfaceB extends EntityParentInterface
+{
+}
diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/EntityParent.php b/src/Symfony/Component/Validator/Tests/Fixtures/EntityParent.php
index acbec3d32e88b..4674f8b35a226 100644
--- a/src/Symfony/Component/Validator/Tests/Fixtures/EntityParent.php
+++ b/src/Symfony/Component/Validator/Tests/Fixtures/EntityParent.php
@@ -13,7 +13,7 @@
use Symfony\Component\Validator\Constraints\NotNull;
-class EntityParent implements EntityInterface
+class EntityParent implements EntityInterfaceA
{
protected $firstName;
private $internal;
diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/EntityParentInterface.php b/src/Symfony/Component/Validator/Tests/Fixtures/EntityParentInterface.php
new file mode 100644
index 0000000000000..3aad6fec5f76e
--- /dev/null
+++ b/src/Symfony/Component/Validator/Tests/Fixtures/EntityParentInterface.php
@@ -0,0 +1,16 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Validator\Tests\Fixtures;
+
+interface EntityParentInterface
+{
+}
diff --git a/src/Symfony/Component/Validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php b/src/Symfony/Component/Validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php
index c78d2a72c8d60..c1aaa9f8c7bf2 100644
--- a/src/Symfony/Component/Validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php
+++ b/src/Symfony/Component/Validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php
@@ -18,17 +18,19 @@
class LazyLoadingMetadataFactoryTest extends \PHPUnit_Framework_TestCase
{
- const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
- const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
- const INTERFACECLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityInterface';
+ const CLASS_NAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
+ const PARENT_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
+ const INTERFACE_A_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityInterfaceA';
+ const INTERFACE_B_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityInterfaceB';
+ const PARENT_INTERFACE_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParentInterface';
public function testLoadClassMetadataWithInterface()
{
$factory = new LazyLoadingMetadataFactory(new TestLoader());
- $metadata = $factory->getMetadataFor(self::PARENTCLASS);
+ $metadata = $factory->getMetadataFor(self::PARENT_CLASS);
$constraints = array(
- new ConstraintA(array('groups' => array('Default', 'EntityInterface', 'EntityParent'))),
+ new ConstraintA(array('groups' => array('Default', 'EntityInterfaceA', 'EntityParent'))),
new ConstraintA(array('groups' => array('Default', 'EntityParent'))),
);
@@ -38,12 +40,12 @@ public function testLoadClassMetadataWithInterface()
public function testMergeParentConstraints()
{
$factory = new LazyLoadingMetadataFactory(new TestLoader());
- $metadata = $factory->getMetadataFor(self::CLASSNAME);
+ $metadata = $factory->getMetadataFor(self::CLASS_NAME);
$constraints = array(
new ConstraintA(array('groups' => array(
'Default',
- 'EntityInterface',
+ 'EntityInterfaceA',
'EntityParent',
'Entity',
))),
@@ -52,6 +54,17 @@ public function testMergeParentConstraints()
'EntityParent',
'Entity',
))),
+ new ConstraintA(array('groups' => array(
+ 'Default',
+ 'EntityParentInterface',
+ 'EntityInterfaceB',
+ 'Entity',
+ ))),
+ new ConstraintA(array('groups' => array(
+ 'Default',
+ 'EntityInterfaceB',
+ 'Entity',
+ ))),
new ConstraintA(array('groups' => array(
'Default',
'Entity',
@@ -67,34 +80,36 @@ public function testWriteMetadataToCache()
$factory = new LazyLoadingMetadataFactory(new TestLoader(), $cache);
$parentClassConstraints = array(
- new ConstraintA(array('groups' => array('Default', 'EntityInterface', 'EntityParent'))),
+ new ConstraintA(array('groups' => array('Default', 'EntityInterfaceA', 'EntityParent'))),
new ConstraintA(array('groups' => array('Default', 'EntityParent'))),
);
- $interfaceConstraints = array(new ConstraintA(array('groups' => array('Default', 'EntityInterface'))));
+ $interfaceAConstraints = array(
+ new ConstraintA(array('groups' => array('Default', 'EntityInterfaceA'))),
+ );
$cache->expects($this->never())
->method('has');
$cache->expects($this->exactly(2))
->method('read')
->withConsecutive(
- array($this->equalTo(self::PARENTCLASS)),
- array($this->equalTo(self::INTERFACECLASS))
+ array($this->equalTo(self::PARENT_CLASS)),
+ array($this->equalTo(self::INTERFACE_A_CLASS))
)
->will($this->returnValue(false));
$cache->expects($this->exactly(2))
->method('write')
->withConsecutive(
- $this->callback(function ($metadata) use ($interfaceConstraints) {
- return $interfaceConstraints == $metadata->getConstraints();
+ $this->callback(function ($metadata) use ($interfaceAConstraints) {
+ return $interfaceAConstraints == $metadata->getConstraints();
}),
$this->callback(function ($metadata) use ($parentClassConstraints) {
return $parentClassConstraints == $metadata->getConstraints();
})
);
- $metadata = $factory->getMetadataFor(self::PARENTCLASS);
+ $metadata = $factory->getMetadataFor(self::PARENT_CLASS);
- $this->assertEquals(self::PARENTCLASS, $metadata->getClassName());
+ $this->assertEquals(self::PARENT_CLASS, $metadata->getClassName());
$this->assertEquals($parentClassConstraints, $metadata->getConstraints());
}
@@ -104,7 +119,7 @@ public function testReadMetadataFromCache()
$cache = $this->getMock('Symfony\Component\Validator\Mapping\Cache\CacheInterface');
$factory = new LazyLoadingMetadataFactory($loader, $cache);
- $metadata = new ClassMetadata(self::PARENTCLASS);
+ $metadata = new ClassMetadata(self::PARENT_CLASS);
$metadata->addConstraint(new ConstraintA());
$loader->expects($this->never())
@@ -116,7 +131,7 @@ public function testReadMetadataFromCache()
->method('read')
->will($this->returnValue($metadata));
- $this->assertEquals($metadata, $factory->getMetadataFor(self::PARENTCLASS));
+ $this->assertEquals($metadata, $factory->getMetadataFor(self::PARENT_CLASS));
}
}
diff --git a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php b/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php
index a29bd1bc93fb1..773effb44590f 100644
--- a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php
+++ b/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php
@@ -84,7 +84,7 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, $isNes
$prefix = Caster::PREFIX_VIRTUAL;
$a += array(
- $prefix.'type' => $c->__toString(),
+ $prefix.'name' => method_exists('ReflectionType', 'getName') ? $c->getName() : $c->__toString(),
$prefix.'allowsNull' => $c->allowsNull(),
$prefix.'isBuiltin' => $c->isBuiltin(),
);
@@ -168,7 +168,7 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra
));
if (isset($a[$prefix.'returnType'])) {
- $a[$prefix.'returnType'] = (string) $a[$prefix.'returnType'];
+ $a[$prefix.'returnType'] = method_exists('ReflectionType', 'getName') ? $a[$prefix.'returnType']->getName() : $a[$prefix.'returnType']->__toString();
}
if (isset($a[$prefix.'this'])) {
$a[$prefix.'this'] = new CutStub($a[$prefix.'this']);
@@ -224,12 +224,13 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st
'position' => 'getPosition',
'isVariadic' => 'isVariadic',
'byReference' => 'isPassedByReference',
+ 'allowsNull' => 'allowsNull',
));
try {
if (method_exists($c, 'hasType')) {
if ($c->hasType()) {
- $a[$prefix.'typeHint'] = $c->getType()->__toString();
+ $a[$prefix.'typeHint'] = method_exists('ReflectionType', 'getName') ? $c->getType()->getName() : $c->getType()->__toString();
}
} else {
$v = explode(' ', $c->__toString(), 6);
@@ -242,15 +243,22 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st
$a[$prefix.'typeHint'] = $m[1];
}
}
+ if (!isset($a[$prefix.'typeHint'])) {
+ unset($a[$prefix.'allowsNull']);
+ }
try {
$a[$prefix.'default'] = $v = $c->getDefaultValue();
if (method_exists($c, 'isDefaultValueConstant') && $c->isDefaultValueConstant()) {
$a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v);
}
+ if (null === $v) {
+ unset($a[$prefix.'allowsNull']);
+ }
} catch (\ReflectionException $e) {
- if (isset($a[$prefix.'typeHint']) && $c->allowsNull()) {
+ if (isset($a[$prefix.'typeHint']) && $c->allowsNull() && !method_exists('ReflectionType', 'getName')) {
$a[$prefix.'default'] = null;
+ unset($a[$prefix.'allowsNull']);
}
}
diff --git a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php
index 1fb617e118f9c..55d199ebe1ddd 100644
--- a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php
+++ b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php
@@ -288,8 +288,7 @@ function isCtrlKey(e) {
};
})(document);
-
-