Skip to content

Commit

Permalink
Merge pull request #33 from fezfez/php8.2
Browse files Browse the repository at this point in the history
Drop support php 7, add php 8.2 support
  • Loading branch information
Ocramius authored Oct 18, 2022
2 parents 62a899a + 9d2b630 commit 60ec04b
Show file tree
Hide file tree
Showing 10 changed files with 553 additions and 655 deletions.
7 changes: 7 additions & 0 deletions .laminas-ci/pre-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Temporary workaround for cyclic dependencies - can be removed once 3.0 has been released

echo "Branch as 2.99.x in Pre-Install"

git checkout -b 2.99.x
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
}
},
"require": {
"php": "^7.3 || ~8.0.0 || ~8.1.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"laminas/laminas-stdlib": "^2.7 || ^3.0"
},
"require-dev": {
"laminas/laminas-coding-standard": "~2.2.1",
"laminas/laminas-mail": "^2.12",
"phpunit/phpunit": "^9.5"
"laminas/laminas-coding-standard": "~2.4.0",
"laminas/laminas-mail": "^2.19.0",
"phpunit/phpunit": "~9.5.25"
},
"suggest": {
"laminas/laminas-mail": "Laminas\\Mail component"
Expand Down
1,171 changes: 525 additions & 646 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@

<!-- Include all rules from Laminas Coding Standard -->
<rule ref="LaminasCodingStandard"/>

<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing">
<exclude-pattern>src/</exclude-pattern>
</rule>
</ruleset>
3 changes: 1 addition & 2 deletions src/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Laminas\Mime;

use function array_key_exists;
use function get_class;
use function gettype;
use function is_object;
use function is_resource;
Expand Down Expand Up @@ -315,7 +314,7 @@ public function setContent($content)
if (! is_string($content) && ! is_resource($content)) {
throw new Exception\InvalidArgumentException(sprintf(
'Content must be string or resource; received "%s"',
is_object($content) ? get_class($content) : gettype($content)
is_object($content) ? $content::class : gettype($content)
));
}
$this->content = $content;
Expand Down
2 changes: 2 additions & 0 deletions test/DecodeTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Mime;

use Laminas\Mail\Headers;
Expand Down
2 changes: 2 additions & 0 deletions test/MessageTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Mime;

use Laminas\Mime;
Expand Down
2 changes: 2 additions & 0 deletions test/MimeTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Mime;

use Laminas\Mime;
Expand Down
2 changes: 2 additions & 0 deletions test/PartTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Mime;

use Laminas\Mime;
Expand Down
7 changes: 4 additions & 3 deletions test/TestAsset/Mail/Headers.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php // phpcs:disable WebimpressCodingStandard.NamingConventions.ValidVariableName.NotCamelCaps,SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse


declare(strict_types=1);

namespace Laminas\Mail;
Expand Down Expand Up @@ -253,7 +254,7 @@ public function addHeaders($headers)
if (! is_array($headers) && ! $headers instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected array or Traversable; received "%s"',
is_object($headers) ? get_class($headers) : gettype($headers)
is_object($headers) ? $headers::class : gettype($headers)
));
}

Expand Down Expand Up @@ -294,7 +295,7 @@ public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null)
'%s expects its first argument to be a string; received "%s"',
__METHOD__,
is_object($headerFieldNameOrLine)
? get_class($headerFieldNameOrLine)
? $headerFieldNameOrLine::class
: gettype($headerFieldNameOrLine)
));
}
Expand Down Expand Up @@ -345,7 +346,7 @@ public function removeHeader($instanceOrFieldName)
'%s requires a string or %s instance; received %s',
__METHOD__,
HeaderInterface::class,
is_object($instanceOrFieldName) ? get_class($instanceOrFieldName) : gettype($instanceOrFieldName)
is_object($instanceOrFieldName) ? $instanceOrFieldName::class : gettype($instanceOrFieldName)
));
}

Expand Down

0 comments on commit 60ec04b

Please sign in to comment.