diff --git a/schema/bg/@home.texy b/schema/bg/@home.texy index 06400a7c5b..eb719b725d 100644 --- a/schema/bg/@home.texy +++ b/schema/bg/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // ОК, връща {'optional' => null, 'nullable' => null} ``` +Масивът от всички свойства на структурата се връща от метода `getShape()`. + По подразбиране във входните данни не може да има допълнителни елементи: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ОШИБКА ``` +Можете да създадете нова структура, като я извлечете от друга с помощта на `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Кортежи .[#toc-tuples] +---------------------- + +Tuples са индексирани масиви, които имат фиксиран брой елементи и всеки елемент може да бъде от различен тип: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Остарели елементи .[#toc-ustarevsie-elementy] --------------------------------------------- diff --git a/schema/cs/@home.texy b/schema/cs/@home.texy index b2d8b4b01f..ba33c6b05a 100644 --- a/schema/cs/@home.texy +++ b/schema/cs/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, vrací {'optional' => null, 'nullable' => null} ``` +Pole všech vlastností struktury vrací metoda `getShape()`. + Ve výchozím nastavení nemohou být ve vstupních datech žádné položky navíc: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // CHYBA ``` +Novou strukturu můžete vytvořit odvozením od jiné pomocí `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuples .{data-version:1.3.1} +---------------------------- + +Tuples jsou indexované pole, které mají pevný počet prvků a každý prvek může mít jiný typ: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Zastaralé vlastnosti -------------------- diff --git a/schema/de/@home.texy b/schema/de/@home.texy index e9493a67c2..f26a4d7911 100644 --- a/schema/de/@home.texy +++ b/schema/de/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, liefert {'optional' => null, 'nullable' => null} ``` +Das Array mit allen Struktureigenschaften wird von der Methode `getShape()` zurückgegeben. + Standardmäßig können keine zusätzlichen Elemente in den Eingabedaten enthalten sein: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERROR ``` +Sie können eine neue Struktur erstellen, indem Sie mit `extend()` von einer anderen ableiten: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tupel .[#toc-tuples] +-------------------- + +Tupel sind indizierte Arrays mit einer festen Anzahl von Elementen, wobei jedes Element einen anderen Typ haben kann: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Verwerfungen .[#toc-deprecations] --------------------------------- diff --git a/schema/el/@home.texy b/schema/el/@home.texy index 73d579437b..5f0c9617eb 100644 --- a/schema/el/@home.texy +++ b/schema/el/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, επιστρέφει {'optional' => null, 'nullable' => null} ``` +Ο πίνακας όλων των ιδιοτήτων της δομής επιστρέφεται από τη μέθοδο `getShape()`. + Από προεπιλογή, δεν μπορούν να υπάρχουν επιπλέον στοιχεία στα δεδομένα εισόδου: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ΣΦΑΛΜΑ ``` +Μπορείτε να δημιουργήσετε μια νέα δομή παράγοντας από μια άλλη χρησιμοποιώντας το `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuples .[#toc-tuples] +--------------------- + +Οι ταπλέτες είναι πίνακες με ευρετήριο που έχουν σταθερό αριθμό στοιχείων και κάθε στοιχείο μπορεί να έχει διαφορετικό τύπο: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Αποσβέσεις .[#toc-deprecations] ------------------------------- diff --git a/schema/en/@home.texy b/schema/en/@home.texy index e9da6d083a..8e60422351 100644 --- a/schema/en/@home.texy +++ b/schema/en/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, returns {'optional' => null, 'nullable' => null} ``` +The array of all structure properties is returned by the `getShape()` method. + By default, there can be no extra items in the input data: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERROR ``` +You can create a new structure by deriving from another using `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuples .{data-version:1.3.1} +---------------------------- + +Tuples are indexed arrays that have a fixed number of elements and each element can have a different type: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Deprecations ------------ diff --git a/schema/es/@home.texy b/schema/es/@home.texy index 5610a275b7..54405d3450 100644 --- a/schema/es/@home.texy +++ b/schema/es/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, devuelve {'optional' => null, 'nullable' => null} ``` +El array de todas las propiedades de la estructura es devuelto por el método `getShape()`. + Por defecto, no puede haber elementos adicionales en los datos de entrada: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERROR ``` +Puede crear una nueva estructura derivando de otra mediante `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuplas .[#toc-tuples] +--------------------- + +Las tuplas son matrices indexadas que tienen un número fijo de elementos y cada elemento puede tener un tipo diferente: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Depreciaciones .[#toc-deprecations] ----------------------------------- diff --git a/schema/fr/@home.texy b/schema/fr/@home.texy index 036493c90a..0ca174dc33 100644 --- a/schema/fr/@home.texy +++ b/schema/fr/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, retourne {'optional' => null, 'nullable' => null}. ``` +Le tableau de toutes les propriétés de la structure est renvoyé par la méthode `getShape()`. + Par défaut, il ne peut y avoir aucun élément supplémentaire dans les données d'entrée : ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERREUR ``` +Vous pouvez créer une nouvelle structure en dérivant d'une autre à l'aide de `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuples .[#toc-tuples] +--------------------- + +Les tuples sont des tableaux indexés qui ont un nombre fixe d'éléments et chaque élément peut avoir un type différent : + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Dépréciations .[#toc-deprecations] ---------------------------------- diff --git a/schema/hu/@home.texy b/schema/hu/@home.texy index c98bb38845..c533cf761b 100644 --- a/schema/hu/@home.texy +++ b/schema/hu/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, visszatér {'optional' => null, 'nullable' => null} ``` +A `getShape()` módszer a struktúra összes tulajdonságát tartalmazó tömböt adja vissza. + Alapértelmezés szerint a bemeneti adatokban nem lehetnek extra elemek: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // HIBA ``` +Új struktúrát hozhat létre egy másik struktúrából származtatva a `extend()` segítségével: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuples .[#toc-tuples] +--------------------- + +A Tuple-ek indexelt tömbök, amelyek fix számú elemmel rendelkeznek, és minden elem különböző típusú lehet: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Deprecations .[#toc-deprecations] --------------------------------- diff --git a/schema/it/@home.texy b/schema/it/@home.texy index 01c04d05c8..64fc14a556 100644 --- a/schema/it/@home.texy +++ b/schema/it/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, restituisce {'optional' => null, 'nullable' => null} ``` +L'array di tutte le proprietà della struttura viene restituito dal metodo `getShape()`. + Per impostazione predefinita, non ci possono essere elementi extra nei dati di input: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERRORE ``` +È possibile creare una nuova struttura derivandola da un'altra utilizzando `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuple .[#toc-tuples] +-------------------- + +Le tuple sono array indicizzati che hanno un numero fisso di elementi e ogni elemento può avere un tipo diverso: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Deprecazioni .[#toc-deprecations] --------------------------------- diff --git a/schema/ja/@home.texy b/schema/ja/@home.texy index a29b9a1617..7880c9dc15 100644 --- a/schema/ja/@home.texy +++ b/schema/ja/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, returns {'optional' => null, 'nullable' => null} ``` +すべての構造体プロパティの配列は、`getShape()` メソッドによって返される。 + デフォルトでは、入力データに余分な項目は存在できない。 ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERROR ``` +`extend()` を使って別の構造から派生させることで、新しい構造を作成できます: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +タプル.[#toc-tuples] +----------------- + +タプルは、固定数の要素を持つインデックス付き配列で、各要素は異なる型を持つことができます: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + 非推奨事項 .[#toc-deprecations] -------------------------- diff --git a/schema/pl/@home.texy b/schema/pl/@home.texy index c05548476b..2a76304aad 100644 --- a/schema/pl/@home.texy +++ b/schema/pl/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, vrací {'optional' => null, 'nullable' => null} ``` +Tablica wszystkich właściwości struktury jest zwracana przez metodę `getShape()`. + Domyślnie w danych wejściowych nie może być żadnych dodatkowych elementów: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // CHYBA ``` +Nową strukturę można utworzyć poprzez wyprowadzenie jej z innej za pomocą `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Krotki .[#toc-tuples] +--------------------- + +Krotki są indeksowanymi tablicami, które mają stałą liczbę elementów, a każdy element może mieć inny typ: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Właściwości przestarzałe .[#toc-deprecations] --------------------------------------------- diff --git a/schema/pt/@home.texy b/schema/pt/@home.texy index 76b78e5a6e..8284aaa9d9 100644 --- a/schema/pt/@home.texy +++ b/schema/pt/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, retorna {'opcional' => nulo, 'anulável' => nulo} ``` +A matriz de todas as propriedades da estrutura é retornada pelo método `getShape()`. + Por padrão, não pode haver itens extras nos dados de entrada: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERROR ``` +Você pode criar uma nova estrutura derivando de outra usando `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuplas .[#toc-tuples] +--------------------- + +As tuplas são matrizes indexadas que têm um número fixo de elementos e cada elemento pode ter um tipo diferente: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Depreciações .[#toc-deprecations] --------------------------------- diff --git a/schema/ro/@home.texy b/schema/ro/@home.texy index 16cb3060f3..2ffb9e923b 100644 --- a/schema/ro/@home.texy +++ b/schema/ro/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, returnează {'optional' => null, 'nullable' => null} ``` +Matricea tuturor proprietăților structurii este returnată de metoda `getShape()`. + În mod implicit, nu pot exista elemente suplimentare în datele de intrare: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERROR ``` +Puteți crea o structură nouă prin derivarea dintr-o alta folosind `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tupluri .[#toc-tuples] +---------------------- + +Tuples sunt array-uri indexate care au un număr fix de elemente și fiecare element poate avea un tip diferit: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Deprecieri .[#toc-deprecations] ------------------------------- diff --git a/schema/ru/@home.texy b/schema/ru/@home.texy index e01893dc5a..8bcbc5121c 100644 --- a/schema/ru/@home.texy +++ b/schema/ru/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, возвращает {'optional' => null, 'nullable' => null} ``` +Массив всех свойств структуры возвращается методом `getShape()`. + По умолчанию, во входных данных не может быть лишних элементов: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ОШИБКА ``` +Вы можете создать новую структуру, производя ее от другой с помощью `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Кортежи .[#toc-tuples] +---------------------- + +Кортежи - это индексированные массивы с фиксированным количеством элементов, каждый из которых может иметь свой тип: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Устаревшие элементы ------------------- diff --git a/schema/sl/@home.texy b/schema/sl/@home.texy index c8c5e6eea5..96658d0307 100644 --- a/schema/sl/@home.texy +++ b/schema/sl/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // V redu, vrne {'optional' => null, 'nullable' => null} ``` +Metoda `getShape()` vrne polje vseh lastnosti strukture. + Privzeto je, da v vhodnih podatkih ne sme biti nobenih dodatnih elementov: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // V REDU $processor->process($schema, ['additional' => true]); // ERROR ``` +Novo strukturo lahko ustvarite tako, da jo izpeljete iz druge strukture z uporabo `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuples .[#toc-tuples] +--------------------- + +Tupli so indeksirane množice, ki imajo določeno število elementov, vsak element pa je lahko različnega tipa: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Deprecations .[#toc-deprecations] --------------------------------- diff --git a/schema/tr/@home.texy b/schema/tr/@home.texy index a2be4b7dbb..b934978633 100644 --- a/schema/tr/@home.texy +++ b/schema/tr/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // Tamam, {'optional' => null, 'nullable' => null} döndürür ``` +Tüm yapı özelliklerinin dizisi `getShape()` yöntemi tarafından döndürülür. + Varsayılan olarak, giriş verilerinde fazladan öğe bulunamaz: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // Tamam $processor->process($schema, ['additional' => true]); // ERROR ``` +`extend()` adresini kullanarak başka bir yapıdan türeterek yeni bir yapı oluşturabilirsiniz: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Tuples .[#toc-tuples] +--------------------- + +Tuple'lar, sabit sayıda elemanı olan ve her elemanı farklı bir türe sahip olabilen indeksli dizilerdir: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Kullanımdan kaldırmalar .[#toc-deprecations] -------------------------------------------- diff --git a/schema/uk/@home.texy b/schema/uk/@home.texy index 44e37d9b68..fd526ba2ba 100644 --- a/schema/uk/@home.texy +++ b/schema/uk/@home.texy @@ -241,6 +241,8 @@ $processor->process($schema, ['nullable' => null]); // OK, повертає {'optional' => null, 'nullable' => null} ``` +Масив усіх властивостей структури повертається методом `getShape()`. + За замовчуванням, у вхідних даних не може бути зайвих елементів: ```php @@ -263,6 +265,35 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ПОМИЛКА ``` +Ви можете створити нову структуру, виводячи її з іншої за допомогою `extend()`: + +```php +$dog = Expect::structure([ + 'name' => Expect::string(), + 'age' => Expect::int(), +]); + +$dogWithBreed = $dog->extend([ + 'breed' => Expect::string(), +]); +``` + + +Кортежі .[#toc-tuples] +---------------------- + +Кортежі - це індексовані масиви, які мають фіксовану кількість елементів, і кожен елемент може мати різний тип: + +```php +$schema = Expect::tuple([ + Expect::int(), + Expect::string(), + Expect::bool(), +]); + +$processor->process($schema, [1, 'hello', true]); // OK +``` + Застарілі елементи .[#toc-ustarevsie-elementy] ----------------------------------------------