Skip to content

Commit

Permalink
Spelling (#206)
Browse files Browse the repository at this point in the history
* spelling: before

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: default

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: deletes

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: entity

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: integer

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: occasionally

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: tired of arguing

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
  • Loading branch information
jsoref committed Aug 8, 2022
1 parent 38e4dd3 commit 39fe908
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -200,7 +200,7 @@ You can see `Dockerfile` and `docker-compose.yml` files there.
PS Any contributions to build a better containers are welcome.

### Open API Types and Declarations
OAS (Open API Specification) was developed as merge of Swagger and RAML specs by two groups of developers (they tired to argue with each other :smile:), thus it became quite popular and
OAS (Open API Specification) was developed as merge of Swagger and RAML specs by two groups of developers (they tired of arguing with each other :smile:), thus it became quite popular and
has been implemented for api-generator

```YAML
Expand All @@ -217,7 +217,7 @@ servers:
enum:
- 80
- 443
defualt: 80
default: 80
basePath:
default: v3 # this version will be used as Modules subdirectory and base path uri in routes e.g. /Modules/V2/ and /v2/articles
# to declare globally which files to include with other components declarations
Expand Down Expand Up @@ -1579,7 +1579,7 @@ Response will be similar to:
```
Note if JWT ```enabled=true```, password will be hashed with ```password_hash``` and saved to password field internally.
Do not bother with ```"password": null,``` attribute it is unset before output for safety.
You can add additional checks on password or other fields ex.: length, strength etc in Model on befor/afterSave events.
You can add additional checks on password or other fields ex.: length, strength etc in Model on before/afterSave events.

An example for JWT refresh - ```http://example.com/api/v1/user/4```:

Expand Down
20 changes: 10 additions & 10 deletions src/Blocks/Entities.php
Expand Up @@ -88,10 +88,10 @@ private function setRelations()
$this->sourceCode .= PHP_EOL;
$relations = $formRequest->relations();
foreach ($relations as $relationEntity) {
$ucEntitty = MigrationsHelper::getObjectName($relationEntity);
$ucEntity = MigrationsHelper::getObjectName($relationEntity);
// determine if ManyToMany, OneToMany, OneToOne rels
$current = $this->getRelationType($this->generator->objectName);
$related = $this->getRelationType($ucEntitty);
$related = $this->getRelationType($ucEntity);
if (empty($current) === false && empty($related) === false) {
$this->createRelationMethod($current, $related, $relationEntity);
}
Expand All @@ -106,13 +106,13 @@ private function setRelations()
*/
private function createRelationMethod(string $current, string $related, string $relationEntity)
{
$ucEntitty = ucfirst($relationEntity);
$ucEntity = ucfirst($relationEntity);
$currentRels = explode(PhpInterface::PIPE, $current);
$relatedRels = explode(PhpInterface::PIPE, $related);
foreach ($relatedRels as $rel) {
if (strpos($rel, $this->generator->objectName) !== false) {
foreach ($currentRels as $cur) {
if (strpos($cur, $ucEntitty) !== false) {
if (strpos($cur, $ucEntity) !== false) {
$isManyCurrent = strpos($cur, self::CHECK_MANY_BRACKETS);
$isManyRelated = strpos($rel, self::CHECK_MANY_BRACKETS);
if ($isManyCurrent === false && $isManyRelated === false) {// OneToOne
Expand Down Expand Up @@ -179,15 +179,15 @@ public function createPivot()
$relations = $formRequest->relations();
$this->sourceCode .= PHP_EOL; // margin top from props
foreach ($relations as $relationEntity) {
$ucEntitty = ucfirst($relationEntity);
$file = $this->generator->formatEntitiesPath()
$ucEntity = ucfirst($relationEntity);
$file = $this->generator->formatEntitiesPath()
. PhpInterface::SLASH . ucfirst($relationEntity) . $this->generator->objectName .
PhpInterface::PHP_EXT;
// check if inverse Entity pivot exists
if (file_exists($file) === false) {
// determine if ManyToMany, OneToMany, OneToOne rels
$current = $this->getRelationType($this->generator->objectName);
$related = $this->getRelationType($ucEntitty);
$related = $this->getRelationType($ucEntity);
if (empty($current) === false && empty($related) === false) {
$this->createPivotClass($current, $related, $relationEntity);
}
Expand All @@ -204,17 +204,17 @@ public function createPivot()
*/
private function createPivotClass(string $current, string $related, string $relationEntity): void
{
$ucEntitty = ucfirst($relationEntity);
$ucEntity = ucfirst($relationEntity);
$currentRels = explode(PhpInterface::PIPE, $current);
$relatedRels = explode(PhpInterface::PIPE, $related);
foreach ($relatedRels as $rel) {
if (strpos($rel, $this->generator->objectName) !== false) {
foreach ($currentRels as $cur) {
if (strpos($cur, $ucEntitty) !== false) {
if (strpos($cur, $ucEntity) !== false) {
$isManyCurrent = strpos($cur, self::CHECK_MANY_BRACKETS);
$isManyRelated = strpos($rel, self::CHECK_MANY_BRACKETS);
if ($isManyCurrent !== false && $isManyRelated !== false) {// ManyToMany
$this->setPivot($ucEntitty);
$this->setPivot($ucEntity);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Blocks/EntitiesTrait.php
Expand Up @@ -203,7 +203,7 @@ protected function mutateBulk(Request $request): Response
}

/**
* Deltes bulk by applying it to transaction/rollback procedure
* Deletes bulk by applying it to transaction/rollback procedure
*
* @param Request $request
* @return Response
Expand Down
2 changes: 1 addition & 1 deletion src/Blocks/Migrations.php
Expand Up @@ -121,7 +121,7 @@ public function createPivot()
{
$file = $this->generator->formatMigrationsPath() . $migrationMask
. PhpInterface::UNDERSCORE . $migrationName . PhpInterface::PHP_EXT;
// if migration file with the same name ocasionally exists we do not override it
// if migration file with the same name occasionally exists we do not override it
$isCreated = FileManager::createFile($file, $this->sourceCode);
if($isCreated)
{
Expand Down
18 changes: 9 additions & 9 deletions src/Blocks/MigrationsAbstract.php
Expand Up @@ -27,7 +27,7 @@ abstract class MigrationsAbstract
/**
* @var array
*/
private array $signedIntergerMap = [
private array $signedIntegerMap = [
ModelsInterface::INT_DIGITS_TINY => ModelsInterface::MIGRATION_METHOD_TINY_INTEGER,
ModelsInterface::INT_DIGITS_SMALL => ModelsInterface::MIGRATION_METHOD_SMALL_INTEGER,
ModelsInterface::INT_DIGITS_MEDIUM => ModelsInterface::MIGRATION_METHOD_MEDIUM_INTEGER,
Expand All @@ -38,7 +38,7 @@ abstract class MigrationsAbstract
/**
* @var array
*/
private array $unsignedIntergerMap = [
private array $unsignedIntegerMap = [
ModelsInterface::INT_DIGITS_TINY => ModelsInterface::MIGRATION_METHOD_UTINYINT,
ModelsInterface::INT_DIGITS_SMALL => ModelsInterface::MIGRATION_METHOD_USMALLINT,
ModelsInterface::INT_DIGITS_MEDIUM => ModelsInterface::MIGRATION_METHOD_UMEDIUMINT,
Expand Down Expand Up @@ -196,17 +196,17 @@ public function setIndex(array $attrVal, string $attrKey): void
private function setIntegerDigit(string $key, int $max = null, bool $signed = false): void
{
if ($signed) {
foreach ($this->signedIntergerMap as $digits => $method) {
$next = next($this->signedIntergerMap);
if ($digits >= $max && ($next === false || ($next !== false && $max < key($this->signedIntergerMap)))) {
foreach ($this->signedIntegerMap as $digits => $method) {
$next = next($this->signedIntegerMap);
if ($digits >= $max && ($next === false || ($next !== false && $max < key($this->signedIntegerMap)))) {
$this->setRow($method, $key);
break;
}
}
} else {
foreach ($this->unsignedIntergerMap as $digits => $method) {
$next = next($this->unsignedIntergerMap);
if ($digits >= $max && ($next === false || ($next !== false && $max < key($this->unsignedIntergerMap)))) {
foreach ($this->unsignedIntegerMap as $digits => $method) {
$next = next($this->unsignedIntegerMap);
if ($digits >= $max && ($next === false || ($next !== false && $max < key($this->unsignedIntegerMap)))) {
$this->setRow($method, $key);
break;
}
Expand Down Expand Up @@ -269,7 +269,7 @@ protected function createMigrationFile(string $migrationName): void
$file = $this->generator->formatMigrationsPath() . $migrationMask . PhpInterface::UNDERSCORE .
$migrationName . PhpInterface::PHP_EXT;

// if migration file with the same name ocasionally exists we do not override it
// if migration file with the same name occasionally exists we do not override it
$isCreated = FileManager::createFile($file, $this->sourceCode);
if ($isCreated) {
Console::out($file . PhpInterface::SPACE . Console::CREATED, Console::COLOR_GREEN);
Expand Down
8 changes: 4 additions & 4 deletions tests/_support/_generated/AcceptanceTesterActions.php
Expand Up @@ -1123,8 +1123,8 @@ public function seeInFormFields($formSelector, $params) {
* ``` php
* <?php
* $I->dontSeeInFormFields('form[name=myform]', [
* 'input1' => 'non-existent value',
* 'input2' => 'other non-existent value',
* 'input1' => 'nonexistent value',
* 'input2' => 'other nonexistent value',
* ]);
* ?>
* ```
Expand Down Expand Up @@ -1171,8 +1171,8 @@ public function cantSeeInFormFields($formSelector, $params) {
* ``` php
* <?php
* $I->dontSeeInFormFields('form[name=myform]', [
* 'input1' => 'non-existent value',
* 'input2' => 'other non-existent value',
* 'input1' => 'nonexistent value',
* 'input2' => 'other nonexistent value',
* ]);
* ?>
* ```
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/oas/openapi.yaml
Expand Up @@ -14,7 +14,7 @@ servers:
enum:
- 80
- 443
defualt: 80
default: 80
basePath:
default: v3
# to declare globally which files to include with other components declarations
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/oas/topic.yaml
Expand Up @@ -11,7 +11,7 @@ servers:
enum:
- 80
- 443
defualt: 80
default: 80
basePath:
default: v3
components:
Expand Down

0 comments on commit 39fe908

Please sign in to comment.