original_string: protected function applyCasts(bool $scalarOnly = false): void
      {
          // @codeCoverageIgnoreStart
          if ( ! $scalarOnly) {
  
              foreach (array_keys($this->casts()) as $key) {
  
                  $this->applyCast($key);
              }
  
              return;
          }
          // @codeCoverageIgnoreEnd
  
          foreach ($this->casts() as $key => $type) {
  
              if ( ! in_array($type, static::SCALAR_CASTS)) {
                  continue;
              }
  
              $this->applyCast($key);
          }
      }
code: protected function applyCasts(bool $scalarOnly = false): void
      {
          // @codeCoverageIgnoreStart
          if ( ! $scalarOnly) {
  
              foreach (array_keys($this->casts()) as $key) {
  
                  $this->applyCast($key);
              }
  
              return;
          }
          // @codeCoverageIgnoreEnd
  
          foreach ($this->casts() as $key => $type) {
  
              if ( ! in_array($type, static::SCALAR_CASTS)) {
                  continue;
              }
  
              $this->applyCast($key);
          }
      }
code_tokens: protected function applyCasts ( bool $ scalarOnly = false ) : void { // @codeCoverageIgnoreStart if ( ! $ scalarOnly ) { foreach ( array_keys ( $ this -> casts ( ) ) as $ key ) { $ this -> applyCast ( $ key ) ; } return ; } // @codeCoverageIgnoreEnd foreach ( $ this -> casts ( ) as $ key => $ type ) { if ( ! in_array ( $ type , static :: SCALAR_CASTS ) ) { continue ; } $ this -> applyCast ( $ key ) ; } }
docstring: Applies casts to currently set attributes.
  
  This updates the values stored for the attributes with a cast type.
  
  @param bool $scalarOnly
docstring_tokens: Applies casts to currently set attributes .