PHP Classes

File: src/Traits/AttrTrait.php

Recommend this page to a friend!
  Packages of Rodolfo Berrios Arce   Parameter   src/Traits/AttrTrait.php   Download  
File: src/Traits/AttrTrait.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Parameter
Validate function parameters with PHP attributes
Author: By
Last change:
Date: 1 year ago
Size: 552 bytes
 

Contents

Class file image Download
<?php

/*
 * This file is part of Chevere.
 *
 * (c) Rodolfo Berrios <rodolfo@chevere.org>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Chevere\Parameter\Traits;

trait AttrTrait
{
    public function withIsSensitive(bool $isSensitive = true): static
    {
        $new = clone $this;
        // @phpstan-ignore-next-line
        $new->parameter = $new->parameter->withIsSensitive($isSensitive);

        return $new;
    }
}