當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Arr::forget方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Arr::forget方法的典型用法代碼示例。如果您正苦於以下問題:PHP Arr::forget方法的具體用法?PHP Arr::forget怎麽用?PHP Arr::forget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Arr的用法示例。


在下文中一共展示了Arr::forget方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Create a new Redis connection instance.
  *
  * @param  array  $servers
  * @return void
  */
 public function __construct(array $servers = [])
 {
     Arr::forget($servers, 'cluster');
     Arr::forget($servers, 'options');
     $this->clients = $this->createClient($servers);
     $this->database = $this->saveDatabase($servers);
 }
開發者ID:targetliu,項目名稱:phpredis,代碼行數:13,代碼來源:Database.php

示例2: except

 /**
  * Get all of the input except for a specified array of items.
  *
  * @param  array  $keys
  * @return array
  */
 public function except($keys)
 {
     $keys = is_array($keys) ? $keys : func_get_args();
     $results = self::all();
     Arr::forget($results, $keys);
     return $results;
 }
開發者ID:efracuadras,項目名稱:slimgeek,代碼行數:13,代碼來源:Request.php

示例3: onDeletedResource

 public static final function onDeletedResource($response)
 {
     $data = (array) json_decode($response->getBody(), true);
     Arr::forget($data, ['code', 'message']);
     $data = json_encode($data);
     return $response->withBody(Psr7\stream_for($data));
 }
開發者ID:loduis,項目名稱:alegra-php,代碼行數:7,代碼來源:Resource.php

示例4: remove

 /**
  * Remove index
  *
  * @param $index
  * @return $this
  */
 public function remove($index)
 {
     if ($this->has($index)) {
         Arr::forget($this->data, $index);
         Arr::forget($this->metas, $this->firstIndex($index));
     }
     return $this;
 }
開發者ID:bruno-barros,項目名稱:wordpress-packages,代碼行數:14,代碼來源:GlobalJs.php

示例5: forget

 /**
  * Remove an item from the configuration
  *
  * @param  string $key
  * @return boolean
  */
 public function forget($key)
 {
     if ($this->has($key)) {
         $this->arrHelper->forget($this->data, $key);
         return true;
     }
     return false;
 }
開發者ID:benrowe,項目名稱:laravel-config,代碼行數:14,代碼來源:Config.php

示例6: start

 /**
  * Starts the bot.
  *
  * @return void 
  */
 public function start()
 {
     set_error_handler(function ($errno, $errstr) {
         if (!(error_reporting() & $errno)) {
             return;
         }
         echo "[Error] {$errno} {$errstr}\r\n";
         throw new \Exception($errstr, $errno);
     }, E_ALL);
     foreach ($this->commands as $command => $data) {
         $this->websocket->on(Event::MESSAGE_CREATE, function ($message, $discord, $new) use($command, $data) {
             $content = explode(' ', $message->content);
             $config = Config::getConfig($this->configfile);
             if ($content[0] == $config['prefix'] . $command) {
                 Arr::forget($content, 0);
                 $user_perms = @$config['perms']['perms'][$message->author->id];
                 if (empty($user_perms)) {
                     $user_perms = $config['perms']['default'];
                 }
                 if ($user_perms >= $data['perms']) {
                     try {
                         $data['class']::handleMessage($message, $content, $discord, $config, $this);
                     } catch (\Exception $e) {
                         $message->reply("There was an error running the command. `{$e->getMessage()}`");
                     }
                 } else {
                     $message->reply('You do not have permission to do this!');
                     echo "[Auth] User {$message->author->username} blocked from running {$config['prefix']}{$command}, <@{$message->author->id}>\r\n";
                 }
             }
         });
     }
     $this->websocket->on('ready', function ($discord) {
         $discord->updatePresence($this->websocket, 'DiscordPHP ' . Discord::VERSION, false);
     });
     $this->websocket->on('error', function ($error, $ws) {
         echo "[Error] {$error}\r\n";
     });
     $this->websocket->on('close', function () {
         echo "[Close] WebSocket was closed.\r\n";
         die;
     });
     $this->websocket->run();
 }
開發者ID:comentarinformal,項目名稱:DiscordPHPBot,代碼行數:49,代碼來源:Bot.php

示例7: unsetRequestInput

 /**
  * Unset a single item in a given Request’s input using dot-notation
  * @param Request $request to modify
  * @param string $key in dot-notation
  */
 protected function unsetRequestInput(Request $request, $key)
 {
     if (strpos($key, '.')) {
         // The data to unset is deeper than 1 level down
         // meaning the final value of the input's first level key is expected to be an array
         list($first_level_key, $key_rest) = explode('.', $key, 2);
         // Pull out the input's existing first level value to modify it as an array
         $first_level_value = $request->input($first_level_key);
         //Request::input() pulls from all input data using dot-notation (ArrayAccess on Request would also pull out files which is undesirable here).
         if (!is_array($first_level_value)) {
             $first_level_value = [];
         }
         Arr::forget($first_level_value, $key_rest);
         $request->merge([$first_level_key => $first_level_value]);
         // The only current alternatives for modifying Request input data are merge() and replace(), the latter replacing the whole input data.
     } else {
         // The data to unset is in the first level
         unset($request[$key]);
     }
 }
開發者ID:fewagency,項目名稱:laravel-reformulator,代碼行數:25,代碼來源:ModifiesRequestInputTrait.php

示例8: remove

 /**
  * {@inheritdoc}
  */
 public function remove($key)
 {
     A::forget($this->expressions, $key);
     $this->reload();
     return $this;
 }
開發者ID:elepunk,項目名稱:evaluator,代碼行數:9,代碼來源:Memory.php

示例9: originExcept

 /**
  * Get all of the origin input except for a specified array of items.
  *
  * @param array|mixed $keys item keys
  * @return array
  */
 public function originExcept($keys)
 {
     $keys = is_array($keys) ? $keys : func_get_args();
     $results = $this->originAll();
     Arr::forget($results, $keys);
     return $results;
 }
開發者ID:mint-soft-com,項目名稱:xpressengine,代碼行數:13,代碼來源:Request.php

示例10: forget

 /**
  * Remove an item from the session.
  *
  * @param string $key
  *
  * @return void
  */
 public static function forget($key)
 {
     Arr::forget($_SESSION, $key);
 }
開發者ID:arrilot,項目名稱:sessions,代碼行數:11,代碼來源:Session.php

示例11: forget

 /**
  * Remove an item from the session.
  *
  * @param  string  $key
  * @return void
  */
 public function forget($key)
 {
     Arr::forget($this->attributes, $key);
 }
開發者ID:hilmysyarif,項目名稱:sisfito,代碼行數:10,代碼來源:Store.php

示例12: removeValidationOption

 /**
  * Remove validation option.
  *
  * @param string $type
  * @param string $key
  *
  * @throws ValidateException
  *
  * @return array
  */
 protected function removeValidationOption($type, $key)
 {
     $this->checkValidationTypes($type);
     Arr::forget($this->validationOptions, "{$type}.{$key}");
     return $this->validationOptions;
 }
開發者ID:iolson,項目名稱:support,代碼行數:16,代碼來源:ValidateTrait.php

示例13: forget

 /**
  * Forget meta value.
  *
  * @param  string  $key
  *
  * @return void
  */
 public function forget($key)
 {
     Arr::forget($this->meta, $key);
 }
開發者ID:stevebauman,項目名稱:html,代碼行數:11,代碼來源:Grid.php

示例14: offsetUnset

 /**
  * Unset the item at a given offset.
  *
  * @param  string  $key
  * @return void
  */
 public function offsetUnset($key)
 {
     $result = $this->convert();
     Arr::forget($result, $key);
     $this->items = Arr::dot($result);
 }
開發者ID:jooorooo,項目名稱:modulator,代碼行數:12,代碼來源:Collection.php

示例15: forget

 /**
  * Forget a value from the repository file.
  *
  * @param string $key
  */
 public function forget($key)
 {
     $contents = $this->getContents();
     Arr::forget($contents, $key);
     $this->saveContents($contents);
 }
開發者ID:clone1018,項目名稱:rocketeer,代碼行數:11,代碼來源:AbstractStorage.php


注:本文中的Illuminate\Support\Arr::forget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。