Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66262 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39770 invoked from network); 27 Feb 2013 08:18:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2013 08:18:41 -0000 Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.48 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.215.48 mail-la0-f48.google.com Received: from [209.85.215.48] ([209.85.215.48:42861] helo=mail-la0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/6B-61918-061CD215 for ; Wed, 27 Feb 2013 03:18:40 -0500 Received: by mail-la0-f48.google.com with SMTP id fq13so270637lab.35 for ; Wed, 27 Feb 2013 00:18:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=GJfAxALlSwGkBx3hgR+wPEC0Y2wW0tkfMapVSiks3Bw=; b=lpmHjwc0LRwhlCHdOdzrYh6KCE6hwjgu7jr3Bc8/Rp7r/AVXkIdgJalBCH+HWuiEGZ PUT6BHjcJixvDZe/JBtweeBSbOdOAPXKmk81Sg8t0z52SqIh5QgYBGsVhjHfJ8u0TO2j dcsVu6knkO1+IKiaxApSSuy2P+4ZCAFRKdBg5eriZO0UmrfLhuddCs/qi4L7RrQWvVTH odrL92dIQBfFnmcFZLaDZ9/2QlVWLtdnjkB6MEu7/nbWAUbM8cu6BDDVPEzqY5EScwac fAadXkE9eW3rqJvoGvO3ZV3+WkMn6fcC0u+YJ+gmC5+ihFdBN0nuVSgnu5weH1fl5V2a 7wig== X-Received: by 10.112.17.166 with SMTP id p6mr1752686lbd.41.1361953116908; Wed, 27 Feb 2013 00:18:36 -0800 (PST) Received: from nikita2206-n56vj ([217.174.184.92]) by mx.google.com with ESMTPS id fz10sm1425239lbb.12.2013.02.27.00.18.35 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 27 Feb 2013 00:18:35 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net References: Date: Wed, 27 Feb 2013 12:18:34 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/12.14 (Linux) Subject: Re: [PHP-DEV] I would like to write an RFC for the addition of an internal keyword From: inefedor@gmail.com ("Nikita Nefedov") On Wed, 27 Feb 2013 11:07:06 +0400, Jens Riisom Schultz wrote: > Hi, > > I just want to get a feel for whether the following idea would be > instantly rejected (for example I get the feeling that adding keywords > is a big deal): > > Often, when writing frameworks, you need to make public or protected > functionality or classes which should only be called from inside the > framework. You CAN ensure this with a lot of ninja tricks and > debug_backtrace, but it is very cumbersome and often hides your methods > and properties from class signatures. > > Therefore I would propose adding a C# style "internal" keyword. ( > http://msdn.microsoft.com/en-us/library/7c5ka91b(v=vs.80).aspx ) > > The idea is, simply, that functions, methods and classes marked as > "internal" would only be accessible from within the namespace in which > they are defined. > > For example the following class, "namespace Framework; internal class > Something {}", would only be visible from within the "Framework" > namespace. > > I have a hunch that this would be relatively easy to implement. > > If noone objects I would attempt to create a patch and an RFC. > > What do you think? > > > -Jens Riisom Schultz > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Hi, I, for one, think it should be solved on the IDE side. I used a lot of Doctrine's internal methods lately and if they would be not accessible I wouldn't be able to do a lot of things. Of course internal methods/classes shouldn't be exposed as a part of API, but if they exist, I would want to call them *if I know what I'm doing*. I think it would be useful if phpdoc had an @internal tag so that IDEs could highlight places where you use internal parts of library.