Completed
Push — master ( 4eff91...8ce34a )
by Marcus
01:39
created

src/Rule/Validate/MySql/MediumBlob.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Mbright\Validation\Rule\Validate\MySql;
4
5
use Mbright\Validation\Rule\Validate\Strlen;
6
7
/**
8
 * Validates that data can be inserted into one of the following column types:
9
 * - MediumBlob
10
 * - MediumText
11
 */
12 View Code Duplication
class MediumBlob extends Strlen
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    /**
15
     * @param int $len Acceptable string length.
16
     */
17 6
    public function __construct(int $len)
18
    {
19 6
        if ($len < 0 || $len > (pow(2, 24))) {
20 6
            throw new \InvalidArgumentException('Medium Blob & Text can only accept lengths between 0 - 2^16');
21
        }
22
23
        parent::__construct($len);
24
    }
25
}
26