Skip to content

Commit

Permalink
hw6 init
Browse files Browse the repository at this point in the history
  • Loading branch information
DR33M committed Sep 17, 2023
1 parent 4039549 commit 8eb2491
Show file tree
Hide file tree
Showing 4 changed files with 488 additions and 0 deletions.
26 changes: 26 additions & 0 deletions app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

use App\Validators\Email as EmailValidator;

require __DIR__ . '/vendor/autoload.php';

$emails = [
'abc',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
];

$emailValidator = new EmailValidator();
foreach ($emails as $email) {
try {
$emailValidator->validate($email);
echo "$email: Is valid";
} catch(Exception $e) {

Check failure on line 22 in app.php

View workflow job for this annotation

GitHub Actions / phpcs

Expected 1 space(s) after CATCH keyword; 0 found
echo "$email: {$e->getMessage()}";
}
echo PHP_EOL;
}
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "otus/php_2023",
"type": "project",
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"require": {
"egulias/email-validator": "^4.0"
}
}
Loading

0 comments on commit 8eb2491

Please sign in to comment.