当前位置: 首页>>代码示例>>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;未经允许,请勿转载。