hasEditLink = $hasEditLink; $this->deleteLink = $deleteLink; $this->hasSortLink = $hasSortLink; $this->hasNavigationBar = $hasNavigationBar; $this->hasBookmarkForm = $hasBookmarkForm; $this->hasTextButton = $hasTextButton; $this->hasPrintLink = $hasPrintLink; } /** * @param array $parts * @psalm-param array{ * hasEditLink?: bool, * deleteLink?: self::NO_DELETE|self::DELETE_ROW|self::KILL_PROCESS, * hasSortLink?: bool, * hasNavigationBar?: bool, * hasBookmarkForm?: bool, * hasTextButton?: bool, * hasPrintLink?: bool * } $parts */ public static function fromArray(array $parts): self { return new self( $parts['hasEditLink'] ?? false, $parts['deleteLink'] ?? self::NO_DELETE, $parts['hasSortLink'] ?? false, $parts['hasNavigationBar'] ?? false, $parts['hasBookmarkForm'] ?? false, $parts['hasTextButton'] ?? false, $parts['hasPrintLink'] ?? false ); } /** * @param array $parts * @psalm-param array{ * hasEditLink?: bool, * deleteLink?: self::NO_DELETE|self::DELETE_ROW|self::KILL_PROCESS, * hasSortLink?: bool, * hasNavigationBar?: bool, * hasBookmarkForm?: bool, * hasTextButton?: bool, * hasPrintLink?: bool * } $parts */ public function with(array $parts): self { return new self( $parts['hasEditLink'] ?? $this->hasEditLink, $parts['deleteLink'] ?? $this->deleteLink, $parts['hasSortLink'] ?? $this->hasSortLink, $parts['hasNavigationBar'] ?? $this->hasNavigationBar, $parts['hasBookmarkForm'] ?? $this->hasBookmarkForm, $parts['hasTextButton'] ?? $this->hasTextButton, $parts['hasPrintLink'] ?? $this->hasPrintLink ); } }