Skip to content

Commit

Permalink
Move files in typical src and tests folder (#242)
Browse files Browse the repository at this point in the history
* Move files in typical src and tests folder

* Fix psalm error
  • Loading branch information
simonschaufi authored Jun 16, 2020
1 parent 2f38a47 commit cfa3d44
Show file tree
Hide file tree
Showing 78 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/Tests export-ignore
/documentation export-ignore
/tests export-ignore
/.* export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
"symfony/polyfill-intl-idn": "^1.10"
},
"require-dev": {
"satooshi/php-coveralls": "^1.0.1",
"dominicsayers/isemail": "^3.0.7",
"phpunit/phpunit": "^4.8.36|^7.5.15",
"dominicsayers/isemail": "^3.0.7"
"satooshi/php-coveralls": "^1.0.1"
},
"suggest": {
"ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
},
"autoload": {
"psr-4": {
"Egulias\\EmailValidator\\": "EmailValidator"
"Egulias\\EmailValidator\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Egulias\\Tests\\": "Tests"
"Egulias\\EmailValidator\\Tests\\": "tests"
}
}
}
6 changes: 3 additions & 3 deletions psalm.baseline.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.8.3@389af1bfc739bfdff3f9e3dc7bd6499aee51a831">
<file src="EmailValidator/EmailLexer.php">
<file src="src/EmailLexer.php">
<DocblockTypeContradiction occurrences="1">
<code>self::$nullToken</code>
</DocblockTypeContradiction>
</file>
<file src="EmailValidator/Parser/Parser.php">
<file src="src/Parser/Parser.php">
<MissingReturnType occurrences="1">
<code>parse</code>
</MissingReturnType>
</file>
<file src="EmailValidator/Validation/SpoofCheckValidation.php">
<file src="src/Validation/SpoofCheckValidation.php">
<UndefinedClass occurrences="2">
<code>Spoofchecker</code>
<code>Spoofchecker</code>
Expand Down
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
errorBaseline="./psalm.baseline.xml"
>
<projectFiles>
<directory name="EmailValidator" />
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion EmailValidator/Parser/Parser.php → src/Parser/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
abstract class Parser
{
/**
* @var \Egulias\EmailValidator\Warning\Warning[]
* @var array
*/
protected $warnings = [];

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Egulias\Tests\EmailValidator;
namespace Egulias\EmailValidator\Tests\EmailValidator;

use Egulias\EmailValidator\EmailLexer;
use PHPUnit\Framework\TestCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Egulias\Tests\EmailValidator;
namespace Egulias\EmailValidator\Tests\EmailValidator;

use Egulias\EmailValidator\EmailValidator;
use Egulias\EmailValidator\Validation\EmailValidation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Egulias\Tests\EmailValidator\Validation;
namespace Egulias\EmailValidator\Tests\EmailValidator\Validation;

use Egulias\EmailValidator\EmailLexer;
use Egulias\EmailValidator\Exception\NoDNSRecord;
Expand All @@ -24,7 +24,7 @@ public function validEmailsProvider()
['"Abc@def"@example.com'],
['"Fred\ Bloggs"@example.com'],
['"Joe.\\Blow"@example.com'],

// unicide
['ñandu.cl'],
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Egulias\Tests\EmailValidator\Validation;
namespace Egulias\EmailValidator\Tests\EmailValidator\Validation;

use Egulias\EmailValidator\EmailValidator;
use Egulias\EmailValidator\Validation\DNSCheckValidation;
Expand All @@ -27,7 +27,7 @@ public function testAgainstIsEmailTestSuite($email)

public function isEmailTestSuite()
{
$testSuite = dirname(__FILE__) . '/../../resources/is_email_tests.xml';
$testSuite = __DIR__ . '/../../resources/is_email_tests.xml';
$document = new \DOMDocument();
$document->load($testSuite);
$elements = $document->getElementsByTagName('test');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Egulias\Tests\EmailValidator\Validation;
namespace Egulias\EmailValidator\Tests\EmailValidator\Validation;

use Egulias\EmailValidator\EmailLexer;
use Egulias\EmailValidator\Exception\CommaInDomain;
Expand All @@ -18,7 +18,7 @@ class MultipleValidationWithAndTest extends TestCase
public function testUsesAndLogicalOperation()
{
$lexer = new EmailLexer();
$validationTrue = $this->getMockBuilder("Egulias\\EmailValidator\\Validation\\EmailValidation")->getMock();
$validationTrue = $this->getMockBuilder(EmailValidation::class)->getMock();
$validationTrue->expects($this->any())->method("isValid")->willReturn(true);
$validationTrue->expects($this->any())->method("getWarnings")->willReturn([]);
$validationFalse = $this->getMockBuilder(EmailValidation::class)->getMock();
Expand Down Expand Up @@ -60,7 +60,7 @@ public function testAccumulatesWarnings()
$expectedResult = array_merge($warnings1, $warnings2);

$lexer = new EmailLexer();
$validation1 = $this->getMockBuilder("Egulias\\EmailValidator\\Validation\\EmailValidation")->getMock();
$validation1 = $this->getMockBuilder(EmailValidation::class)->getMock();
$validation1->expects($this->any())->method("isValid")->willReturn(true);
$validation1->expects($this->once())->method("getWarnings")->willReturn($warnings1);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Egulias\Tests\EmailValidator\Validation;
namespace Egulias\EmailValidator\Tests\EmailValidator\Validation;

use Egulias\EmailValidator\EmailLexer;
use Egulias\EmailValidator\Exception\NoDomainPart;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Egulias\Tests\EmailValidator\Validation;
namespace Egulias\EmailValidator\Tests\EmailValidator\Validation;

use Egulias\EmailValidator\EmailLexer;
use Egulias\EmailValidator\Validation\RFCValidation;
Expand Down Expand Up @@ -104,7 +104,7 @@ public function getValidEmails()

public function testInvalidUTF8Email()
{
$email = "\x80\x81\x82@\x83\x84\x85.\x86\x87\x88";
$email = "\x80\x81\x82@\x83\x84\x85.\x86\x87\x88";
$this->assertFalse($this->validator->isValid($email, $this->lexer));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Egulias\Tests\EmailValidator\Validation;
namespace Egulias\EmailValidator\Tests\EmailValidator\Validation;

use Egulias\EmailValidator\EmailLexer;
use Egulias\EmailValidator\Validation\SpoofCheckValidation;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cfa3d44

Please sign in to comment.