Subversion Repositories oidplus

Rev

Rev 1086 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /*
  4.  * OIDplus 2.0
  5.  * Copyright 2019 - 2023 Daniel Marschall, ViaThinkSoft
  6.  *
  7.  * Licensed under the Apache License, Version 2.0 (the "License");
  8.  * you may not use this file except in compliance with the License.
  9.  * You may obtain a copy of the License at
  10.  *
  11.  *     http://www.apache.org/licenses/LICENSE-2.0
  12.  *
  13.  * Unless required by applicable law or agreed to in writing, software
  14.  * distributed under the License is distributed on an "AS IS" BASIS,
  15.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16.  * See the License for the specific language governing permissions and
  17.  * limitations under the License.
  18.  */
  19.  
  20. namespace ViaThinkSoft\OIDplus;
  21.  
  22. // phpcs:disable PSR1.Files.SideEffects
  23. \defined('INSIDE_OIDPLUS') or die;
  24. // phpcs:enable PSR1.Files.SideEffects
  25.  
  26. class OIDplusOidAsn1Id {
  27.         /**
  28.          * @var string
  29.          */
  30.         private $name = '';
  31.  
  32.         /**
  33.          * @var bool
  34.          */
  35.         private $standardized = false;
  36.  
  37.         /**
  38.          * @var bool
  39.          */
  40.         private $well_known = false;
  41.  
  42.         /**
  43.          * @param string $name
  44.          * @param bool $standardized
  45.          * @param bool $well_known
  46.          */
  47.         function __construct(string $name, bool $standardized, bool $well_known) {
  48.                 $this->name = $name;
  49.                 $this->standardized = $standardized;
  50.                 $this->well_known = $well_known;
  51.         }
  52.  
  53.         /**
  54.          * @return string
  55.          */
  56.         function getName(): string {
  57.                 return $this->name;
  58.         }
  59.  
  60.         /**
  61.          * @return bool
  62.          */
  63.         function isStandardized(): bool {
  64.                 return $this->standardized;
  65.         }
  66.  
  67.         /**
  68.          * @return bool
  69.          */
  70.         function isWellKnown(): bool {
  71.                 return $this->well_known;
  72.         }
  73.  
  74.         /**
  75.          * @return string
  76.          */
  77.         function __toString(): string {
  78.                 return $this->name;
  79.         }
  80. }
  81.