Giter Club home page Giter Club logo

Comments (20)

Oleksii909 avatar Oleksii909 commented on July 20, 2024
<?php

namespace Drupal\Component\Utility;

/**
 * Provides helper methods for reflection.
 */
final class Reflection {

  /**
   * Gets the parameter's class name.
   *
   * @param \ReflectionParameter $parameter
   *   The parameter.
   *
   * @return string|null
   *   The parameter's class name or NULL if the parameter is not a class.
   */
  public static function getParameterClassName(\ReflectionParameter $parameter) : ?string {
    $name = NULL;
    if ($parameter->hasType() && !$parameter->getType()->isBuiltin()) {
      $name = $parameter->getType()->getName();
      $lc_name = strtolower($name);
      switch ($lc_name) {
        case 'self':
          return $parameter->getDeclaringClass()->getName();

        case 'parent':
          return ($parent = $parameter->getDeclaringClass()->getParentClass()) ? $parent->name : NULL;
      }
    }
    return $name;
  }

}

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

Let us know more about type resource in php
image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

@andypost Please provide a comment for this commit:
image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

@andypost Please provide a comment for this commit:
image

<?php
  /**
   * {@inheritdoc}
   */
  public function rollBack($savepoint_name = 'drupal_transaction') {
    // MySQL will automatically commit transactions when tables are altered or
    // created (DDL transactions are not supported). Prevent triggering an
    // exception to ensure that the error that has caused the rollback is
    // properly reported.
    if (!$this->connection->inTransaction()) {
      // On PHP 7 $this->connection->inTransaction() will return TRUE and
      // $this->connection->rollback() does not throw an exception; the
      // following code is unreachable.

      // If \Drupal\Core\Database\Connection::rollBack() would throw an
      // exception then continue to throw an exception.
      if (!$this->inTransaction()) {
        throw new TransactionNoActiveException();
      }
      // A previous rollback to an earlier savepoint may mean that the savepoint
      // in question has already been accidentally committed.
      if (!isset($this->transactionLayers[$savepoint_name])) {
        throw new TransactionNoActiveException();
      }

      trigger_error('Rollback attempted when there is no active transaction. This can cause data integrity issues.', E_USER_WARNING);
      return;
    }
    return parent::rollBack($savepoint_name);
  }

  /**
   * {@inheritdoc}
   */
  protected function doCommit() {
    // MySQL will automatically commit transactions when tables are altered or
    // created (DDL transactions are not supported). Prevent triggering an
    // exception in this case as all statements have been committed.
    if ($this->connection->inTransaction()) {
      // On PHP 7 $this->connection->inTransaction() will return TRUE and
      // $this->connection->commit() does not throw an exception.
      $success = parent::doCommit();
    }
    else {
      // Process the post-root (non-nested) transaction commit callbacks. The
      // following code is copied from
      // \Drupal\Core\Database\Connection::doCommit()
      $success = TRUE;
      if (!empty($this->rootTransactionEndCallbacks)) {
        $callbacks = $this->rootTransactionEndCallbacks;
        $this->rootTransactionEndCallbacks = [];
        foreach ($callbacks as $callback) {
          call_user_func($callback, $success);
        }
      }
    }
    return $success;
  }

@andypost, Thank you for such clear comments in commit.
Чи могли б ви прокоментувати цю контрибуцію на живо, тому що доить складно усвідомити цей кусок тесту:
image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

Unescaped "@" in ContextProviderInterface doc comment
image
Issue #3014969 by TR, longwave, Abhijith S, joachim, shimpy

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image
image
image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

:"typo3/phar-stream-wrapper": "v3.1.6"
image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

Sort direction is not hidden when no sort field is selected
image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

image

from -.

Oleksii909 avatar Oleksii909 commented on July 20, 2024

Refactor WHY??? Issue #2987980 by alexpott, longwave, Lendude, jibran: Refactor UncaughtExceptionTest to not use cUrl

from -.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.